I want to change from WebSql to Indexeddb. However, how would one do SQL queries like
SELECT * FROM customers WHERE ssn = '444-44-4444' and emal = 'bill@[email protected]'
SELECT * FROM customers WHERE ssn = '444-44-4444' and emal = 'bill@[email protected]' and age = 30
SELECT * FROM customers WHERE ssn = '444-44-4444' and emal = 'bill@[email protected]' and name = 'Bill'
etc
with IndexedDB ? For example, I noticed while reading the documentation of indexedDb, that all the examples only query one index at the time. So you can do
var index = objectStore.index("ssn");
index.get("444-44-4444").onsuccess = function(event) {
alert("Name is " + event.target.result.name);
};
But I need to query multiple indexes at the same time!
I also found some interesting posts about compound indexes, but they only work if you query for all the fields in the compound index.