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

Error (only on IE) when trying to read a store, if store has saved with a composed key #62

Closed srveiga closed 9 years ago

srveiga commented 9 years ago

var db = new ydn.db.Storage('results', schema); ... //saved db.put('tableName', valuesToStoreObj, [valuesToStoreObj.id1, valuesToStoreObj.id2]) ... var df = db.values('tableName'); ... //Error executing the next line df.done( function (items) { //some code }

ERROR from IE developer tools: SCRIPT5022: DataError File: ydn.db-isw-crud-dev.js, Line: 148, Column: 178

The error only occurs in Internet Explorer (tested with version IE 11). In Firefox and Chrome the error does not happen and the same code runs without any error. After some debug I have found out that the error occurs because the store has a composed key.

If the 'valuesToStoreObj' is saved like in the next line the error does not occur.
db.put('tableName', valuesToStoreObj, valuesToStoreObj.id1)

yathit commented 9 years ago

Yes. See browser supports as limitation in https://dev.yathit.com/ydn-db/doc/setup/limitation.html