Files
onebox/ts/database/types.ts

18 lines
455 B
TypeScript
Raw Normal View History

/**
* Database types and interfaces
*/
import * as plugins from '../plugins.ts';
// Type alias for sqlite bind parameters
export type TBindValue = string | number | bigint | boolean | null | undefined | Uint8Array;
// Database connection type
export type TDatabaseConnection = InstanceType<typeof plugins.sqlite.DB>;
// Query function type
export type TQueryFunction = <T = Record<string, unknown>>(
sql: string,
params?: TBindValue[]
) => T[];