MCPcopy
hub / github.com/sequelize/sequelize / insert

Method insert

lib/dialects/abstract/query-interface.js:764–776  ·  view source on GitHub ↗
(instance, tableName, values, options)

Source from the content-addressed store, hash-verified

762 }
763
764 async insert(instance, tableName, values, options) {
765 options = Utils.cloneDeep(options);
766 options.hasTrigger = instance && instance.constructor.options.hasTrigger;
767 const sql = this.queryGenerator.insertQuery(tableName, values, instance && instance.constructor.rawAttributes, options);
768
769 options.type = QueryTypes.INSERT;
770 options.instance = instance;
771
772 const results = await this.sequelize.query(sql, options);
773 if (instance) results[0].isNewRecord = false;
774
775 return results;
776 }
777
778 /**
779 * Upsert

Callers 1

testFunction · 0.80

Calls 2

insertQueryMethod · 0.80
queryMethod · 0.45

Tested by 1

testFunction · 0.64