Merge pull request #6359 from Rocketmakers/knex-additions

Add some extra things for knex
This commit is contained in:
Masahiro Wakame
2015-10-21 23:29:00 +09:00
2 changed files with 13 additions and 1 deletions
+8 -1
View File
@@ -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);
}
}
});
+5
View File
@@ -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;