2016-03-02 16:52:32 +01:00
|
|
|
|
|
|
|
var inherits = require('inherits')
|
|
|
|
var Formatter = require('../../formatter')
|
|
|
|
var ReturningHelper = require('./utils').ReturningHelper
|
|
|
|
|
|
|
|
import {assign} from 'lodash'
|
|
|
|
|
|
|
|
function Oracle_Formatter(client) {
|
|
|
|
Formatter.call(this, client)
|
|
|
|
}
|
|
|
|
inherits(Oracle_Formatter, Formatter)
|
|
|
|
|
|
|
|
assign(Oracle_Formatter.prototype, {
|
|
|
|
|
|
|
|
alias: function(first, second) {
|
|
|
|
return first + ' ' + second;
|
|
|
|
},
|
|
|
|
|
|
|
|
parameter: function(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 Formatter.prototype.parameter.call(this, value, notSetValue)
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
2015-05-09 13:58:18 -04:00
|
|
|
module.exports = Oracle_Formatter
|