Javascript database module for Indexeddb, Web SQL and localStorage storage mechanisms supporting version migration, advanced query, SQL and transaction.
It seems as if compound indices are not supported in memory storage. See comment in following method:
ydn.db.con.simple.Store.prototype.updateIndex = function(key, value) {
for (var idx in this.key_indexes) {
var cache = this.key_indexes[idx];
if (cache) {
if (ydn.db.con.simple.Store.DEBUG) {
goog.global.console.log('updating ' + key + ' in index ' + idx + ' of ' +
this.schema.getName());
}
if (idx == this.primary_index) {
cache.add(new ydn.db.con.simple.Node(key));
} else {
var index = this.schema.getIndex(idx);
// When using compound index definition, index.getKeyPath() would return eg. ["name", "count"]
var index_key = ydn.db.utils.getValueByKeys(value, index.getKeyPath());
if (goog.isDefAndNotNull(index_key)) {
var node = new ydn.db.con.simple.Node(key, index_key);
cache.add(node);
}
}
}
}
};
It seems as if compound indices are not supported in memory storage. See comment in following method: