Sqlite database result type as object instead of default array


Hey all!

In some situation we may required result type as object instead of array while querying into local database using awesome nativescript-sqlite.

So we may change the result type by passing the resultType as below mentioned,

var Sqlite = require(‘nativescriipt-sqlite’);

var db_promise = new Sqlite("MyTable").then(function(db) {


      console.log("Are we open yet (Inside Promise)? ", db.isOpen() ? "Yes" : "No"); // Yes


   }, function(err) {

     console.error("We failed to open database", err);


Thanks to @NathanaelA & @nraboy.

Hope this may help someone.