yathit / ydn-db

Javascript database module for Indexeddb, Web SQL and localStorage storage mechanisms supporting version migration, advanced query, SQL and transaction.
Apache License 2.0
503 stars 41 forks source link

SQL - SELECT * not work correctly with cordova-plugin-sqlite-2 + how to get column without primary key #120

Open andig89 opened 7 years ago

andig89 commented 7 years ago

First problem:

CREATE TABLE 'attach-store' (digest UNIQUE, escaped TINYINT(1), body BLOB);
INSERT INTO "attach-store" VALUES ('md5-tp0Fnc2N1/P+oPtsz1vjzQ==', 1, 'test');
test.executeSql('SELECT * FROM "attach-store"').then(function(results) {
  console.log(results);
}, function(e) {
  throw e;
});

Results:

{"digest":[-6.058867998439701e+274,[[[""]]]],"body":"test"}

Second:

CREATE TABLE 'attach-store' (digest UNIQUE, escaped TINYINT(1), body BLOB);
INSERT INTO "attach-store" VALUES ('md5-tp0Fnc2N1/P+oPtsz1vjzQ==', 1, 'test');

How make 'SELECT "digest" FROM "attach-store"' without SQL query?