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

Method isInsertQuery

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

Source from the content-addressed store, hash-verified

170 }
171
172 isInsertQuery(results, metaData) {
173 let result = true;
174
175 if (this.options.type === QueryTypes.INSERT) {
176 return true;
177 }
178
179 // is insert query if sql contains insert into
180 result = result && this.sql.toLowerCase().startsWith('insert into');
181
182 // is insert query if no results are passed or if the result has the inserted id
183 result = result && (!results || Object.prototype.hasOwnProperty.call(results, this.getInsertIdField()));
184
185 // is insert query if no metadata are passed or if the metadata has the inserted id
186 result = result && (!metaData || Object.prototype.hasOwnProperty.call(metaData, this.getInsertIdField()));
187
188 return result;
189 }
190
191 handleInsertQuery(results, metaData) {
192 if (this.instance) {

Callers 8

runMethod · 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