Merge pull request #23907 from shreyjain1994/master

Add additional typings for config options for `Knex`
This commit is contained in:
Benjamin Lichtman
2018-02-28 13:01:32 -08:00
committed by GitHub
2 changed files with 19 additions and 0 deletions
+3
View File
@@ -5,6 +5,7 @@
// Pablo Rodríguez <https://github.com/MeLlamoPablo>
// Matt R. Wilson <https://github.com/mastermatt>
// Satana Charuwichitratana <https://github.com/micksatana>
// Shrey Jain <https://github.com/shreyjain1994>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -524,6 +525,8 @@ declare namespace Knex {
MySqlConnectionConfig | MsSqlConnectionConfig | Sqlite3ConnectionConfig | SocketConnectionConfig;
pool?: PoolConfig;
migrations?: MigratorConfig;
postProcessResponse?: (result: any, queryContext: any) => any;
wrapIdentifier?: (value: string, origImpl: (value: string) => string, queryContext: any) => string;
seeds?: SeedsConfig;
acquireConnectionTimeout?: number;
useNullAsDefault?: boolean;
+16
View File
@@ -126,6 +126,22 @@ var knex = Knex({
searchPath: ['public', 'private'],
});
// postProcessResponse
var knex = Knex({
client: 'pg',
postProcessResponse: function(result, queryContext){
return result;
}
});
// wrapIdentifier
var knex = Knex({
client: 'pg',
wrapIdentifier: function(value, origImpl, queryContext){
return origImpl(value + 'foo');
}
});
// useNullAsDefault
var knex = Knex({
client: 'sqlite',