MCPcopy Index your code
hub / github.com/sequelize/sequelize / insert

Method insert

src/dialects/abstract/query-interface.js:787–799  ·  view source on GitHub ↗
(instance, tableName, values, options)

Source from the content-addressed store, hash-verified

785 }
786
787 async insert(instance, tableName, values, options) {
788 options = Utils.cloneDeep(options);
789 options.hasTrigger = instance && instance.constructor.options.hasTrigger;
790 const sql = this.queryGenerator.insertQuery(tableName, values, instance && instance.constructor.rawAttributes, options);
791
792 options.type = QueryTypes.INSERT;
793 options.instance = instance;
794
795 const results = await this.sequelize.query(sql, options);
796 if (instance) results[0].isNewRecord = false;
797
798 return results;
799 }
800
801 /**
802 * Upsert

Callers 1

testFunction · 0.80

Calls 2

insertQueryMethod · 0.80
queryMethod · 0.45

Tested by 1

testFunction · 0.64