Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return Object.assign(tag(function() {
let sqls = flat(originals
.map(v =>
is_string(v) ? [{ text: columnize(v) }, { text: ', ' }] :
is_tag(v) ? [v(), { text: ', ' }] :
[{ text: Object.entries(v).map(v => v.map(dq).join(' AS ')).join(', ')}, { text: ', ' }]));
sqls.pop();
return merge_query(sqls, '');
}), { [SymbolColumn]: true, originals: originals });
}
const DEFAULTS = go(
columns,
map(k => [k, SymbolDefault]),
object);
values = values
.map(v => Object.assign({}, DEFAULTS, v))
.map(v => Object.values(v));
return {
text: `(${COLUMN(...columns)().text}) VALUES (${
values
.map(v => v.map(v => v == SymbolDefault ? 'DEFAULT' : to_q()).join(', '))
.join('), (')})`,
values: flat(values.map(v => v.filter(v => v != SymbolDefault)))
}
});
}