Merge pull request #21811 from baronfel/undefined_trx

[knex] allow for undefined transactions
This commit is contained in:
Armando Aguirre
2017-11-28 16:50:13 -08:00
committed by GitHub
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -156,7 +156,7 @@ declare namespace Knex {
delete(returning?: string | string[]): QueryBuilder;
truncate(): QueryBuilder;
transacting(trx: Transaction): QueryBuilder;
transacting(trx?: Transaction): QueryBuilder;
connection(connection: any): QueryBuilder;
clone(): QueryBuilder;
+3
View File
@@ -672,6 +672,9 @@ knex.transaction<{ length: number }>(function(trx) {
console.error(error);
});
// transacting handles undefined
knex.insert({ name: 'Old Books'}).transacting(undefined);
knex.schema.withSchema("public").hasTable("table") as Promise<boolean>;
knex.schema.createTable('users', function (table) {