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

Method logWarnings

lib/dialects/snowflake/query.js:198–220  ·  view source on GitHub ↗
(results)

Source from the content-addressed store, hash-verified

196 }
197
198 async logWarnings(results) {
199 const warningResults = await this.run('SHOW WARNINGS');
200 const warningMessage = `Snowflake Warnings (${this.connection.uuid || 'default'}): `;
201 const messages = [];
202 for (const _warningRow of warningResults) {
203 if (_warningRow === undefined || typeof _warningRow[Symbol.iterator] !== 'function') {
204 continue;
205 }
206 for (const _warningResult of _warningRow) {
207 if (Object.prototype.hasOwnProperty.call(_warningResult, 'Message')) {
208 messages.push(_warningResult.Message);
209 } else {
210 for (const _objectKey of _warningResult.keys()) {
211 messages.push([_objectKey, _warningResult[_objectKey]].join(': '));
212 }
213 }
214 }
215 }
216
217 this.sequelize.log(warningMessage + messages.join('; '), this.options);
218
219 return results;
220 }
221
222 formatError(err) {
223 const errCode = err.errno || err.code;

Callers 1

runMethod · 0.95

Calls 2

runMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected