| 8 | * and is also responsible for connection pooling (if the dialect supports pooling). |
| 9 | */ |
| 10 | export interface Driver { |
| 11 | /** |
| 12 | * Initializes the driver. |
| 13 | * |
| 14 | * After calling this method the driver should be usable and `acquireConnection` etc. |
| 15 | * methods should be callable. |
| 16 | */ |
| 17 | init(options?: AbortableOperationOptions): Promise<void> |
| 18 | |
| 19 | /** |
| 20 | * Acquires a new connection from the pool. |
| 21 | */ |
| 22 | acquireConnection( |
| 23 | options?: AbortableOperationOptions, |
| 24 | ): Promise<DatabaseConnection> |
| 25 | |
| 26 | /** |
| 27 | * Begins a transaction. |
| 28 | */ |
| 29 | beginTransaction( |
| 30 | connection: DatabaseConnection, |
| 31 | settings: TransactionSettings, |
| 32 | ): Promise<void> |
| 33 | |
| 34 | /** |
| 35 | * Commits a transaction. |
| 36 | */ |
| 37 | commitTransaction(connection: DatabaseConnection): Promise<void> |
| 38 | |
| 39 | /** |
| 40 | * Rolls back a transaction. |
| 41 | */ |
| 42 | rollbackTransaction(connection: DatabaseConnection): Promise<void> |
| 43 | |
| 44 | /** |
| 45 | * Establishses a new savepoint within a transaction. |
| 46 | */ |
| 47 | savepoint?( |
| 48 | connection: DatabaseConnection, |
| 49 | savepointName: string, |
| 50 | compileQuery: QueryCompiler['compileQuery'], |
| 51 | ): Promise<void> |
| 52 | |
| 53 | /** |
| 54 | * Rolls back to a savepoint within a transaction. |
| 55 | */ |
| 56 | rollbackToSavepoint?( |
| 57 | connection: DatabaseConnection, |
| 58 | savepointName: string, |
| 59 | compileQuery: QueryCompiler['compileQuery'], |
| 60 | ): Promise<void> |
| 61 | |
| 62 | /** |
| 63 | * Releases a savepoint within a transaction. |
| 64 | */ |
| 65 | releaseSavepoint?( |
| 66 | connection: DatabaseConnection, |
| 67 | savepointName: string, |
no outgoing calls
no test coverage detected
searching dependent graphs…