mirror of
https://github.com/knex/knex.git
synced 2025-12-18 02:28:44 +00:00
22 lines
593 B
JavaScript
22 lines
593 B
JavaScript
const Formatter = require('../../formatter');
|
|
const Raw = require('../../raw');
|
|
|
|
module.exports = class SQlite3_Formatter extends Formatter {
|
|
values(values) {
|
|
if (Array.isArray(values)) {
|
|
if (Array.isArray(values[0])) {
|
|
return `( values ${values
|
|
.map((value) => `(${this.parameterize(value)})`)
|
|
.join(', ')})`;
|
|
}
|
|
return `(${this.parameterize(values)})`;
|
|
}
|
|
|
|
if (values instanceof Raw) {
|
|
return `(${this.client.parameter(values, this.builder, this)})`;
|
|
}
|
|
|
|
return this.client.parameter(values, this.builder, this);
|
|
}
|
|
};
|