typings for postProcessResponse and wrapIdentifier config options

This commit is contained in:
shrey
2018-02-25 13:15:06 -05:00
parent 407064f7a3
commit e154334d1b
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',