Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function runNativeArrayTest(callback) {
console.log("!-------------- Starting RNA Test");
db.resultType(sqlite.RESULTSASARRAY);
db.valueType(sqlite.VALUESARENATIVE);
const tests = [
// Callback
{name: 'NativeArray Check', sql: 'select count(*) from tests', results: [2], use: 0},
{name: 'NativeArray Get', sql: 'select * from tests where int_field=?', values: [2], results: [2,4.8,5.6,'Text2'], use: 0},
{name: 'NativeArray All', sql: 'select * from tests order by int_field', results: [[1,1.2,2.4,"Text1"],[2,4.8,5.6,'Text2']], use: 1},
{name: 'NativeArray Each', sql: 'select * from tests order by int_field', results: [[1,1.2,2.4,"Text1"],[2,4.8,5.6,'Text2']], use: 2},
// Promise
{name: 'NativeArray Promise Check', sql: 'select count(*) from tests', results: [2], use: 3},
{name: 'NativeArray Promise Get', sql: 'select * from tests where int_field=?', values: [2], results: [2,4.8,5.6,'Text2'], use: 3},
{name: 'NativeArray Promise All', sql: 'select * from tests order by int_field', results: [[1,1.2,2.4,"Text1"],[2,4.8,5.6,'Text2']], use: 4},
{name: 'NativeArray Promise Each', sql: 'select * from tests order by int_field', results: [[1,1.2,2.4,"Text1"],[2,4.8,5.6,'Text2']], use: 5}
];
function runPreparedTests(callback) {
if (!sqlite.HAS_COMMERCIAL) {
callback();
return;
}
db.resultType(sqlite.RESULTSASARRAY);
db.valueType(sqlite.VALUESARENATIVE);
setupPreparedTests(function() {
createPreparedData(true, function () {
let tests = [{
name: 'Verify Rollback Check',
sql: 'select count(*) from preparetests',
results: [0],
use: 0
}];
runTestGroup(tests, function () {
createPreparedData(false, function () {
tests = [{
name: 'Verify Commit Check',