mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-15 22:40:21 +00:00
Merge pull request #6359 from Rocketmakers/knex-additions
Add some extra things for knex
This commit is contained in:
+8
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Vendored
+5
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user