MCPcopy
hub / github.com/sequelize/sequelize / isInsertQuery

Method isInsertQuery

src/dialects/abstract/query.js:196–213  ·  view source on GitHub ↗
(results, metaData)

Source from the content-addressed store, hash-verified

194 }
195
196 isInsertQuery(results, metaData) {
197 let result = true;
198
199 if (this.options.type === QueryTypes.INSERT) {
200 return true;
201 }
202
203 // is insert query if sql contains insert into
204 result = result && this.sql.toLowerCase().startsWith('insert into');
205
206 // is insert query if no results are passed or if the result has the inserted id
207 result = result && (!results || Object.prototype.hasOwnProperty.call(results, this.getInsertIdField()));
208
209 // is insert query if no metadata are passed or if the metadata has the inserted id
210 result = result && (!metaData || Object.prototype.hasOwnProperty.call(metaData, this.getInsertIdField()));
211
212 return result;
213 }
214
215 handleInsertQuery(results, metaData) {
216 if (this.instance) {

Callers 9

runMethod · 0.80
formatResultsMethod · 0.80
formatResultsMethod · 0.80
formatResultsMethod · 0.80
formatResultsMethod · 0.80
formatResultsMethod · 0.80
_handleQueryResponseMethod · 0.80
getDatabaseMethodMethod · 0.80
formatResultsMethod · 0.80

Calls 1

getInsertIdFieldMethod · 0.95

Tested by

no test coverage detected