How to use the nativescript-sqlite.HAS_COMMERCIAL function in nativescript-sqlite

To help you get started, we’ve selected a few nativescript-sqlite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NathanaelA / nativescript-sqlite / demo / app / main-page.js View on Github external
const sqlite = require('nativescript-sqlite');
const ObservableArray = require("tns-core-modules/data/observable-array").ObservableArray;


//var Tracing = require('./tracing.js');
//Tracing(sqlite, {ignore: ["close", "resultType", "valueType", "_toStringArray", "_getResultEngine"], disableAddedFunction: true});


var dbname = 'name_db.sqlite';
var db = null;
var enc_db = null;
var page = null;

var data = new ObservableArray();

if (sqlite.HAS_COMMERCIAL) {
	console.log("Using Commercial");
	data.push({name:'Commercial Support', css:'one'});
} else {
	console.log("No Commercial Support");
}

if (sqlite.HAS_ENCRYPTION) {
	console.log("Using Encryption");
	//dbname = 'encrypted.sqlite';
	data.push({name:'Encryption Support', css:'one'});
} else {
	console.log("No Encryption");
}
data.push({name: 'Loading...', css: 'one'});
github NathanaelA / nativescript-sqlite / demo / app / main-page.js View on Github external
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 () {