treojs / treo

Consistent API to IndexedDB

Home Page:http://treojs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using treo-websql plugin in IE 11

vlad-shevchenko opened this issue · comments

commented

The following code works in Chrome but fails in IE 11:

requirejs(["app/treo/treo", "app/treo/treo-websql"], function (treo, treoWebsql) {
  var schema = treo.schema().
        version(1)
            .addStore("data", {increment: true})
                .addIndex("index", "indexFld");

    var dbObj = treo("db", schema).use(treoWebsql());
    dbObj.version = 1;

     var os = dbObj.store("data");

    os.put(undefined, {data: "data", indexFld: 1}, function () {console.log("ok")})
})

It fails with "DataError" (that's all information IE gives) at 145 line of treo.js (I just copied file content from repository) while trying to put an entity.

If I remove autoincrementing and provide a key for entities, it works. I suspect I may use treo incorrectly. Could you confirm it's a bug or point me to my mistake?