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

Function format

lib/sql-string.js:96–110  ·  view source on GitHub ↗
(sql, values, timeZone, dialect)

Source from the content-addressed store, hash-verified

94exports.escape = escape;
95
96function format(sql, values, timeZone, dialect) {
97 values = [].concat(values);
98
99 if (typeof sql !== 'string') {
100 throw new Error(`Invalid SQL string provided: ${sql}`);
101 }
102
103 return sql.replace(/\?/g, match => {
104 if (!values.length) {
105 return match;
106 }
107
108 return escape(values.shift(), timeZone, dialect, true);
109 });
110}
111exports.format = format;
112
113function formatNamedParameters(sql, values, timeZone, dialect) {

Callers

nothing calls this directly

Calls 1

escapeFunction · 0.85

Tested by

no test coverage detected