MCPcopy
hub / github.com/sequelize/sequelize / logWarnings

Method logWarnings

lib/dialects/mysql/query.js:187–209  ·  view source on GitHub ↗
(results)

Source from the content-addressed store, hash-verified

185 }
186
187 async logWarnings(results) {
188 const warningResults = await this.run('SHOW WARNINGS');
189 const warningMessage = `MySQL Warnings (${this.connection.uuid || 'default'}): `;
190 const messages = [];
191 for (const _warningRow of warningResults) {
192 if (_warningRow === undefined || typeof _warningRow[Symbol.iterator] !== 'function') {
193 continue;
194 }
195 for (const _warningResult of _warningRow) {
196 if (Object.prototype.hasOwnProperty.call(_warningResult, 'Message')) {
197 messages.push(_warningResult.Message);
198 } else {
199 for (const _objectKey of _warningResult.keys()) {
200 messages.push([_objectKey, _warningResult[_objectKey]].join(': '));
201 }
202 }
203 }
204 }
205
206 this.sequelize.log(warningMessage + messages.join('; '), this.options);
207
208 return results;
209 }
210
211 formatError(err, errStack) {
212 const errCode = err.errno || err.code;

Callers 3

runMethod · 0.95
query.test.jsFile · 0.45
query.test.jsFile · 0.45

Calls 2

runMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected