How to use the nativescript-sqlite.HAS_SYNC 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
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'});


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


exports.pageLoaded = function(args) {
	page = args.object;
	page.bindingContext = {names: data};

	if (!sqlite.exists(dbname)) {
		sqlite.copyDatabase(dbname);
	}
	new sqlite(dbname, {key: 'testing', multithreading: !!sqlite.HAS_COMMERCIAL, migrate: true}, function(err, dbConnection) {
		if (err) {