How to use the nativescript-sqlite.VALUESARESTRINGS 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
function runStringArrayTest(callback) {
	console.log("!--------------  Starting RSA Test");
	db.resultType(sqlite.RESULTSASARRAY);
	db.valueType(sqlite.VALUESARESTRINGS);
	const tests = [
		// Callback Version
		{name: 'StringArray Get', sql: 'select * from tests where int_field=?', values: [2], results: ["2","4.8","5.6",'Text2'], use: 0},
		{name: 'StringArray 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: 'StringArray 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 Version
		{name: 'StringArray Promise Get', sql: 'select * from tests where int_field=?', values: [2], results: ["2","4.8","5.6",'Text2'], use: 3},
		{name: 'StringArray 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: 'StringArray 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}
	];
	runTestGroup(tests, callback);
}