I'd like to create a javascript function that returns an SQLite record value.
But how can I solve the scope?
function LeeSQLite() {
  var valor = "";
  var myDB = window.sqlitePlugin.openDatabase({
    name: 'myDB.db',
    location: 'default'
  });
  myDB.transaction(function(transaction) {
    var SQL = "SELECT desc FROM user_table WHERE id = 1";
    transaction.executeSql(SQL, [], function(tx, results) {
      valor = results.rows.item(0).desc;
    }, null);
  });
  return valor;
}
 
    