diff --git a/knex/knex-test.ts b/knex/knex-test.ts index 081f98867d..1d468b2605 100644 --- a/knex/knex-test.ts +++ b/knex/knex-test.ts @@ -12,6 +12,7 @@ var knex = Knex({ }); var knex = Knex({ + debug: true, client: 'mysql', connection: { socketPath : '/path/to/socket.sock', @@ -32,7 +33,13 @@ var knex = Knex({ }, pool: { min: 0, - max: 7 + max: 7, + afterCreate: (connection: any, callback: Function) => { + return callback(null, connection); + }, + beforeDestroy: (connection: any, callback: Function) => { + return callback(null, connection); + } } }); diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 82c26cfec6..d2afc4aa82 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -135,6 +135,8 @@ declare module "knex" { transacting(trx: Transaction): QueryBuilder; connection(connection: any): QueryBuilder; + + clone(): QueryBuilder; } interface As { @@ -394,6 +396,7 @@ declare module "knex" { } interface Config { + debug?: boolean; client?: string; dialect?: string; connection: string|ConnectionConfig| @@ -427,7 +430,9 @@ declare module "knex" { interface PoolConfig { name?: string; create?: Function; + afterCreate?: Function; destroy?: Function; + beforeDestroy?: Function; min?: number; max?: number; refreshIdle?: boolean;