| 295 | * Runtime contract implemented by concrete database adapters. |
| 296 | */ |
| 297 | export interface DatabaseAdapter { |
| 298 | /** Database dialect name exposed by the adapter. */ |
| 299 | dialect: string |
| 300 | /** Feature flags describing the adapter's supported behaviors. */ |
| 301 | capabilities: AdapterCapabilities |
| 302 | /** Compiles a data-manipulation operation into executable SQL statements. */ |
| 303 | compileSql(operation: DataManipulationOperation): SqlStatement[] |
| 304 | /** Executes a data-manipulation request. */ |
| 305 | execute(request: DataManipulationRequest): Promise<DataManipulationResult> |
| 306 | /** |
| 307 | * Executes a raw SQL script that may contain multiple statements. |
| 308 | * |
| 309 | * Drivers must be configured to accept multi-statement scripts where required |
| 310 | * (for example, mysql2 needs `multipleStatements: true`). |
| 311 | */ |
| 312 | executeScript(sql: string, transaction?: TransactionToken): Promise<void> |
| 313 | /** Checks whether a table exists. */ |
| 314 | hasTable(table: TableRef, transaction?: TransactionToken): Promise<boolean> |
| 315 | /** Checks whether a column exists on a table. */ |
| 316 | hasColumn(table: TableRef, column: string, transaction?: TransactionToken): Promise<boolean> |
| 317 | /** Starts a new database transaction. */ |
| 318 | beginTransaction(options?: TransactionOptions): Promise<TransactionToken> |
| 319 | /** Commits an open transaction. */ |
| 320 | commitTransaction(token: TransactionToken): Promise<void> |
| 321 | /** Rolls back an open transaction. */ |
| 322 | rollbackTransaction(token: TransactionToken): Promise<void> |
| 323 | /** Creates a savepoint inside an open transaction. */ |
| 324 | createSavepoint(token: TransactionToken, name: string): Promise<void> |
| 325 | /** Rolls back to a previously created savepoint. */ |
| 326 | rollbackToSavepoint(token: TransactionToken, name: string): Promise<void> |
| 327 | /** Releases a previously created savepoint. */ |
| 328 | releaseSavepoint(token: TransactionToken, name: string): Promise<void> |
| 329 | /** Acquires the adapter's migration lock when supported. */ |
| 330 | acquireMigrationLock?(): Promise<void> |
| 331 | /** Releases the adapter's migration lock when supported. */ |
| 332 | releaseMigrationLock?(): Promise<void> |
| 333 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…