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

Feature for Queryresult, to return primary key #97

Open tjunussov opened 8 years ago

tjunussov commented 8 years ago

It would be nice to have second parameter as array of Primary keys

var df = db.values('sales');
  df.done(function (items) {
    console.log(items);
  });

to smth

var df = db.values('sales');
  df.done(function (items,pks) {
    console.log(items);
        console.log(pks); // Echo primary keys
  });
yathit commented 8 years ago

It is not possible with Promise. You have to use db.open or db.scan to get both value and key.