| 86 | } |
| 87 | |
| 88 | export interface DatabaseEngine { |
| 89 | getType(): KnexClient |
| 90 | |
| 91 | getConnection(): knexlib.Knex | CustomSqliteEngine | null |
| 92 | |
| 93 | /** |
| 94 | * Returns true if the connection is okay |
| 95 | */ |
| 96 | isOkay(): Promise<boolean> |
| 97 | |
| 98 | /** |
| 99 | * Gets the tables in the database |
| 100 | */ |
| 101 | getTables(): Promise<string[]> |
| 102 | |
| 103 | getTableCreationSql(table: string): Promise<string> |
| 104 | |
| 105 | getColumns(table: string): Promise<Column[]> |
| 106 | |
| 107 | /** |
| 108 | * Returns a list of column type names that are numeric |
| 109 | */ |
| 110 | getNumericColumnTypeNamesLowercase(): string[] |
| 111 | |
| 112 | getTotalRows(table: string, columns: Column[], whereClause?: Record<string, any>): Promise<number> |
| 113 | |
| 114 | getRows(table: string, columns: Column[], limit: number, offset: number, whereClause?: Record<string, any>): Promise<QueryResponse | undefined> |
| 115 | |
| 116 | commitChange(serializedMutation: SerializedMutation, transaction: knexlib.Knex.Transaction | SQLiteTransaction): Promise<void> |
| 117 | |
| 118 | getVersion(): Promise<string | undefined> |
| 119 | |
| 120 | disconnect(): Promise<void> |
| 121 | |
| 122 | rawQuery(code: string): Promise<any> |
| 123 | } |
| 124 | |
| 125 | export type QueryResponse = { |
| 126 | rows: any[] |
no outgoing calls
no test coverage detected