MCPcopy Create free account
hub / github.com/damms005/devdb-vscode / DatabaseEngine

Interface DatabaseEngine

src/types.ts:88–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88export 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
125export type QueryResponse = {
126 rows: any[]

Callers 88

getAvailableProvidersFunction · 0.65
getTablesFunction · 0.65
writeMutationsFunction · 0.65
startHttpServerFunction · 0.65
getConnectionMethod · 0.65
getConnectionMethod · 0.65
commitChangeMethod · 0.65
sql.test.tsFile · 0.65
sqlite.test.tsFile · 0.65
writeMutationsFunction · 0.65

Implementers 7

PostgresSshEnginesrc/database-engines/postgres-ssh-engi
MysqlSshEnginesrc/database-engines/mysql-ssh-engine.
MysqlEnginesrc/database-engines/mysql-engine.ts
MssqlEnginesrc/database-engines/mssql-engine.ts
SqliteEnginesrc/database-engines/sqlite-engine.ts
PostgresEnginesrc/database-engines/postgres-engine.t
MongodbEnginesrc/database-engines/mongodb-engine.ts

Calls

no outgoing calls

Tested by

no test coverage detected