Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('1.1.2 ARRAY format explicitly', function(done) {
connection.should.be.ok();
connection.execute(
query, {id: 20}, {outFormat: oracledb.OUT_FORMAT_ARRAY},
function(err, result){
should.not.exist(err);
(result.rows).should.eql([[ 20, 'Marketing' ]]);
done();
}
);
});
it('106.3.8 fetchInfo, resultSet = true', function(done) {
var option_rs = {
resultSet: true,
outFormat: oracledb.OUT_FORMAT_ARRAY,
fetchInfo: { "CONTENT": { type: oracledb.STRING } }
};
test2(option_rs, false, done);
});
});
it('58.1.12 outFormat', function() {
var t = oracledb.outFormat;
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT;
t.should.eql(oracledb.OUT_FORMAT_ARRAY);
(oracledb.outFormat).should.not.eql(defaultValues.outFormat);
});
it('1.1.1 ARRAY format by default', function(done) {
var defaultFormat = oracledb.outFormat;
defaultFormat.should.be.exactly(oracledb.OUT_FORMAT_ARRAY);
connection.should.be.ok();
connection.execute(query, [40], function(err, result){
should.not.exist(err);
(result.rows).should.eql([[ 40, 'Human Resources' ]]);
done();
});
});
it('117.6.5 resultSet = true', function(done) {
var option_rs = {
resultSet: true,
outFormat: oracledb.OUT_FORMAT_ARRAY
};
test1(option_rs, false, true, done);
});
it('116.6.8 resultSet = true', function(done) {
var option_rs = {
resultSet: true,
outFormat: oracledb.OUT_FORMAT_ARRAY,
};
test2(option_rs, false, false, done);
});
function(cb) {
connection.execute(
"SELECT ID, C AS C1, C AS C2 from nodb_clob1 WHERE ID = " + id,
{ },
{ outFormat : oracledb.OUT_FORMAT_ARRAY },
function(err, result) {
should.not.exist(err);
var resultVal = result.rows[0][1];
compareClientFetchResult(err, resultVal, specialStr, content, contentLength);
resultVal = result.rows[0][2];
compareClientFetchResult(err, resultVal, specialStr, content, contentLength);
cb();
}
);
}
], done);
function(cb) {
connection.execute(
"SELECT ID, B from nodb_blob1 WHERE id = " + id_1 + " or id = " +id_2,
{ },
{
outFormat : oracledb.OUT_FORMAT_ARRAY,
fetchInfo : { B : { type : oracledb.BUFFER } }
},
function(err, result) {
should.not.exist(err);
result.rows.length.should.eql(2);
var resultVal = result.rows[0][1];
compareClientFetchResult(err, resultVal, specialStr_1, content_1, contentLength_1);
resultVal = result.rows[1][1];
compareClientFetchResult(err, resultVal, specialStr_2, content_2, contentLength_2);
oracledb.maxRows = maxRowsBak;
cb();
}
);
}
], done);
describe('106.3 works with fetchInfo and outFormat = ARRAY', function() {
var maxRowBak = oracledb.maxRows;
var option = {
outFormat: oracledb.OUT_FORMAT_ARRAY,
fetchInfo: { "CONTENT": { type: oracledb.STRING } }
};
before(function(done) {
async.series([
function makeTable(callback) {
connection.execute(
proc_create_table,
function(err) {
should.not.exist(err);
callback();
});
},
function insertRow(callback) {
insertData(connection, tableName, callback);
},
function fillRowid(callback) {
const getObjectDdl = (
connection,
getFunctionName,
{ owner, objectName, objectType1 }
) => {
oracledb.outFormat = oracledb.OUT_FORMAT_ARRAY;
return connection
.execute(
`select ${getFunctionName}(upper(:objectType1), upper(:objectName), upper(:owner)) from dual`,
{
owner,
objectName,
objectType1
}
)
.then(result => result.rows[0][0]);
};