|
2 | 2 | CompiledQuery, |
3 | 3 | type DatabaseConnection, |
4 | 4 | type Driver, |
| 5 | + type QueryCompiler, |
5 | 6 | type QueryResult, |
6 | 7 | type TransactionSettings, |
7 | 8 | } from 'kysely' |
@@ -38,23 +39,47 @@ export class PostgresJSDriver implements Driver { |
38 | 39 | await connection.commitTransaction() |
39 | 40 | } |
40 | 41 |
|
| 42 | + async destroy(): Promise<void> { |
| 43 | + // biome-ignore lint/style/noNonNullAssertion: `init` ran at this point. |
| 44 | + await this.#postgres!.end() |
| 45 | + } |
| 46 | + |
41 | 47 | async init(): Promise<void> { |
42 | 48 | const { postgres } = this.#config |
43 | 49 |
|
44 | 50 | this.#postgres = isPostgresJSSql(postgres) ? postgres : await postgres() |
45 | 51 | } |
46 | 52 |
|
47 | | - async rollbackTransaction(connection: PostgresJSConnection): Promise<void> { |
48 | | - await connection.rollbackTransaction() |
49 | | - } |
50 | | - |
51 | 53 | async releaseConnection(connection: PostgresJSConnection): Promise<void> { |
52 | 54 | connection.releaseConnection() |
53 | 55 | } |
54 | 56 |
|
55 | | - async destroy(): Promise<void> { |
56 | | - // biome-ignore lint/style/noNonNullAssertion: `init` ran at this point. |
57 | | - await this.#postgres!.end() |
| 57 | + releaseSavepoint( |
| 58 | + connection: DatabaseConnection, |
| 59 | + savepointName: string, |
| 60 | + compileQuery: QueryCompiler['compileQuery'], |
| 61 | + ): Promise<void> { |
| 62 | + // TODO: ... |
| 63 | + } |
| 64 | + |
| 65 | + rollbackToSavepoint( |
| 66 | + connection: DatabaseConnection, |
| 67 | + savepointName: string, |
| 68 | + compileQuery: QueryCompiler['compileQuery'], |
| 69 | + ): Promise<void> { |
| 70 | + // TODO: ... |
| 71 | + } |
| 72 | + |
| 73 | + async rollbackTransaction(connection: PostgresJSConnection): Promise<void> { |
| 74 | + await connection.rollbackTransaction() |
| 75 | + } |
| 76 | + |
| 77 | + savepoint( |
| 78 | + connection: DatabaseConnection, |
| 79 | + savepointName: string, |
| 80 | + compileQuery: QueryCompiler['compileQuery'], |
| 81 | + ): Promise<void> { |
| 82 | + // TODO: ... |
58 | 83 | } |
59 | 84 | } |
60 | 85 |
|
|
0 commit comments