MCPcopy
hub / github.com/sequelize/sequelize / format

Function format

src/sql-string.js:163–177  ·  view source on GitHub ↗
(sql, values, timeZone, dialect)

Source from the content-addressed store, hash-verified

161exports.escape = escape;
162
163function format(sql, values, timeZone, dialect) {
164 values = [].concat(values);
165
166 if (typeof sql !== 'string') {
167 throw new Error(`Invalid SQL string provided: ${sql}`);
168 }
169
170 return sql.replace(/\?/g, match => {
171 if (!values.length) {
172 return match;
173 }
174
175 return escape(values.shift(), timeZone, dialect, true);
176 });
177}
178exports.format = format;
179
180function formatNamedParameters(sql, values, timeZone, dialect) {

Callers

nothing calls this directly

Calls 1

escapeFunction · 0.85

Tested by

no test coverage detected