mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
knex: default batchInsert chunkSize arg (#23064)
* knex: optional batchInsert chunkSize arg * knex: add test for optional batchInsert
This commit is contained in:
Vendored
+1
-1
@@ -29,7 +29,7 @@ interface Knex extends Knex.QueryInterface {
|
||||
transaction<T>(transactionScope: (trx: Knex.Transaction) => Promise<T> | Bluebird<T> | void): Bluebird<T>;
|
||||
destroy(callback: Function): void;
|
||||
destroy(): Bluebird<void>;
|
||||
batchInsert(tableName: TableName, data: any[], chunkSize: number): Knex.QueryBuilder;
|
||||
batchInsert(tableName: TableName, data: any[], chunkSize?: number): Knex.QueryBuilder;
|
||||
schema: Knex.SchemaBuilder;
|
||||
queryBuilder(): Knex.QueryBuilder;
|
||||
|
||||
|
||||
@@ -487,6 +487,7 @@ knex('books')
|
||||
.insert([{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}]);
|
||||
|
||||
knex.batchInsert('books', [{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}], 200);
|
||||
knex.batchInsert('books', [{title: 'Catcher In The Rye'}, {title: 'Pride And Prejudice'}]);
|
||||
knex.queryBuilder().table('books');
|
||||
|
||||
knex('books').where('published_date', '<', 2000).update({status: 'archived'});
|
||||
|
||||
Reference in New Issue
Block a user