How to use the nativescript-sqlite.HAS_ENCRYPTION 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
new sqlite(dbname, {key: 'testing', multithreading: !!sqlite.HAS_COMMERCIAL, migrate: true}, function(err, dbConnection) {
		if (err) {
			console.log(err, err.stack);
		}
		db = dbConnection;
		db.resultType(sqlite.RESULTSASOBJECT);

		db.version().then(function (results) {
			console.log("User Version: ", results, typeof results, Number.isNumber(results)); //, String.isString(results));
		});

		if (sqlite.HAS_ENCRYPTION) {
			db.get("PRAGMA cipher_version;").then(function(results) {
				console.log("Cipher version", results['cipher_version']);
			});
		}

		reloadData();
	}).catch(function(val) {
		console.log("sqlite error", val);