MCPcopy
hub / github.com/sequelize/sequelize / handleInsertQuery

Method handleInsertQuery

lib/dialects/abstract/query.js:191–202  ·  view source on GitHub ↗
(results, metaData)

Source from the content-addressed store, hash-verified

189 }
190
191 handleInsertQuery(results, metaData) {
192 if (this.instance) {
193 // add the inserted row id to the instance
194 const autoIncrementAttribute = this.model.autoIncrementAttribute;
195 let id = null;
196
197 id = id || results && results[this.getInsertIdField()];
198 id = id || metaData && metaData[this.getInsertIdField()];
199
200 this.instance[autoIncrementAttribute] = id;
201 }
202 }
203
204 isShowTablesQuery() {
205 return this.options.type === QueryTypes.SHOWTABLES;

Callers

nothing calls this directly

Calls 1

getInsertIdFieldMethod · 0.95

Tested by

no test coverage detected