dijkstra-backend-cloudron/node_modules/knex/lib/dialects/oracle/formatter.js

21 lines
601 B
JavaScript
Raw Permalink Normal View History

const Formatter = require('../../formatter');
const { ReturningHelper } = require('./utils');
class Oracle_Formatter extends Formatter {
alias(first, second) {
return first + ' ' + second;
}
parameter(value, notSetValue) {
// Returning helper uses always ROWID as string
if (value instanceof ReturningHelper && this.client.driver) {
value = new this.client.driver.OutParam(this.client.driver.OCCISTRING);
} else if (typeof value === 'boolean') {
value = value ? 1 : 0;
}
return super.parameter(value, notSetValue);
}
}
module.exports = Oracle_Formatter;