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

Method bulkInsert

src/dialects/abstract/query-interface.js:877–887  ·  view source on GitHub ↗

* 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

875 * @returns {Promise}
876 */
877 async bulkInsert(tableName, records, options, attributes) {
878 options = { ...options };
879 options.type = QueryTypes.INSERT;
880
881 const results = await this.sequelize.query(
882 this.queryGenerator.bulkInsertQuery(tableName, records, options, attributes),
883 options
884 );
885
886 return results[0];
887 }
888
889 async update(instance, tableName, values, identifier, options) {
890 options = { ...options };

Callers 3

testFunction · 0.80
recursiveBulkCreateMethod · 0.80

Calls 2

queryMethod · 0.45
bulkInsertQueryMethod · 0.45

Tested by 1

testFunction · 0.64