UNPKG

kysely

Version:

Type safe SQL query builder

17 lines (16 loc) 479 B
/// <reference types="./default-connection-provider.d.ts" /> export class DefaultConnectionProvider { #driver; constructor(driver) { this.#driver = driver; } async provideConnection(consumer, options) { const connection = await this.#driver.acquireConnection(options); try { return await consumer(connection); } finally { await this.#driver.releaseConnection(connection, options); } } }