Fixed returning bug with oracle

Fixes non working returning() with oracle introduced with #580 (strong-oracle support)
This commit is contained in:
Vincent Schoettke 2015-03-16 10:04:49 +01:00
parent e9782a8932
commit 5cd47fab98

View File

@ -7,8 +7,6 @@ var _ = require('lodash');
var Client = require('../../client');
var Promise = require('../../promise');
var oracle;
// Always initialize with the "QueryBuilder" and "QueryCompiler"
// objects, which extend the base 'lib/query/builder' and
// 'lib/query/compiler', respectively.
@ -131,11 +129,13 @@ Client_Oracle.prototype.preprocessBindings = function(bindings) {
if (!bindings) {
return bindings;
}
var driver = this.driver;
return bindings.map(function(binding) {
if (binding instanceof ReturningHelper && oracle) {
if (binding instanceof ReturningHelper && driver) {
// returning helper uses always ROWID as string
return new oracle.OutParam(oracle.OCCISTRING);
return new driver.OutParam(driver.OCCISTRING);
}
if (typeof binding === 'boolean') {