46 changed files with 127 additions and 114 deletions
@ -1,17 +1,21 @@ |
|||
export type SqlValue = string | number | null | Uint8Array; |
|||
|
|||
export interface QueryExecResult { |
|||
export interface QueryExecResultRaw { |
|||
columns: Array<string>; |
|||
values: Array<Array<SqlValue>>; |
|||
} |
|||
|
|||
export interface DatabaseService { |
|||
initialize(): Promise<void>; |
|||
query(sql: string, params?: unknown[]): Promise<QueryExecResult[]>; |
|||
query(sql: string, params?: unknown[]): Promise<QueryExecResultRaw[]>; |
|||
run( |
|||
sql: string, |
|||
params?: unknown[], |
|||
): Promise<{ changes: number; lastId?: number }>; |
|||
getOneRow(sql: string, params?: unknown[]): Promise<unknown[] | undefined>; |
|||
getAll(sql: string, params?: unknown[]): Promise<unknown[][]>; |
|||
|
|||
// Change this to return QueryExecResultRaw[] so that we can create objects with the right keys
|
|||
// getOneRow(sql: string, params?: unknown[]): Promise<unknown[] | undefined>;
|
|||
|
|||
// Change this to return QueryExecResultRaw[] so that we can create objects with the right keys
|
|||
// getAll(sql: string, params?: unknown[]): Promise<unknown[][]>;
|
|||
} |
|||
|
Loading…
Reference in new issue