* Pulls cancellation controls out of a `loggerContext` payload, returning the abort options * and a sanitized context that no longer carries them. The QueryBuilder/EM stash * `signal`/`inflightQueryAbortStrategy` on `loggerContext` to avoid widening the public * connection API; stripping them pre
(loggerContext?: LoggingOptions)
| 27 | * connection API; stripping them prevents leakage into user `Logger.logQuery` payloads. |
| 28 | */ |
| 29 | function extractAbortOptions(loggerContext?: LoggingOptions): { |
| 30 | abort?: AbortQueryOptions; |
| 31 | loggerContext?: LoggingOptions; |
| 32 | } { |
| 33 | const ctx = loggerContext as (LoggingOptions & Partial<AbortQueryOptions>) | undefined; |
| 34 | if (ctx?.signal == null && ctx?.inflightQueryAbortStrategy == null) { |
| 35 | return { loggerContext }; |
| 36 | } |
| 37 | const { signal, inflightQueryAbortStrategy, ...rest } = ctx; |
| 38 | return { |
| 39 | abort: { signal, inflightQueryAbortStrategy }, |
| 40 | loggerContext: rest as LoggingOptions, |
| 41 | }; |
| 42 | } |
| 43 | |
| 44 | /** Base class for SQL database connections, built on top of Kysely. */ |
| 45 | export abstract class AbstractSqlConnection extends Connection { |