forked from trent_larson/crowd-funder-for-time-pwa
add more to the inital migration, and refactor the locations of types
This commit is contained in:
14
src/interfaces/database.ts
Normal file
14
src/interfaces/database.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export type SqlValue = string | number | null | Uint8Array;
|
||||
|
||||
export interface QueryExecResult {
|
||||
columns: Array<string>;
|
||||
values: Array<Array<SqlValue>>;
|
||||
}
|
||||
|
||||
export interface DatabaseService {
|
||||
initialize(): Promise<void>;
|
||||
query(sql: string, params?: any[]): Promise<QueryExecResult[]>;
|
||||
run(sql: string, params?: any[]): Promise<{ changes: number; lastId?: number }>;
|
||||
get(sql: string, params?: any[]): Promise<any[] | undefined>;
|
||||
all(sql: string, params?: any[]): Promise<any[][]>;
|
||||
}
|
||||
Reference in New Issue
Block a user