MCPcopy
hub / github.com/sequelize/sequelize / bulkInsert

Method bulkInsert

lib/dialects/abstract/query-interface.js:854–864  ·  lib/dialects/abstract/query-interface.js::QueryInterface.bulkInsert

* Insert multiple records into a table * * @example * queryInterface.bulkInsert('roles', [{ * label: 'user', * createdAt: new Date(), * updatedAt: new Date() * }, { * label: 'admin', * createdAt: new Date(), * updatedAt: new Date() * }]); *

(tableName, records, options, attributes)

Source from the content-addressed store, hash-verified

852 * @returns {Promise}
853 */
854 async bulkInsert(tableName, records, options, attributes) {
855 options = { ...options };
856 options.type = QueryTypes.INSERT;
857
858 const results = await this.sequelize.query(
859 this.queryGenerator.bulkInsertQuery(tableName, records, options, attributes),
860 options
861 );
862
863 return results[0];
864 }
865
866 async update(instance, tableName, values, identifier, options) {
867 options = { ...options };

Callers 2

testFunction · 0.80
recursiveBulkCreateMethod · 0.80

Calls 2

queryMethod · 0.45
bulkInsertQueryMethod · 0.45

Tested by 1

testFunction · 0.64