* @inheritDoc
()
| 108 | * @inheritDoc |
| 109 | */ |
| 110 | async checkConnection(): Promise<{ ok: true } | { ok: false; reason: string; error?: Error }> { |
| 111 | if (!this.connected) { |
| 112 | return { ok: false, reason: 'Connection not established' }; |
| 113 | } |
| 114 | |
| 115 | try { |
| 116 | await this.getClient().executeQuery(CompiledQuery.raw('select 1')); |
| 117 | return { ok: true }; |
| 118 | } catch (error: any) { |
| 119 | return { ok: false, reason: error.message, error }; |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | /** Returns the underlying Kysely client, creating it synchronously if needed. */ |
| 124 | getClient<T = any>(): Kysely<T> { |
nothing calls this directly
no test coverage detected