You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UNIQUE key doesn't work with localStorage engine. #566
Activity
Add test430 for issue AlaSQL#566
Merge pull request #570 from a-gorbunov/develop
a-gorbunov commentedon Jan 31, 2016
Same with PRIMARY KEY.
I created 2 same tables. First - without storage engine. Second - using localStorage.
2 table definitions from alasql.databases.exampleDb.tables.exampleTable are posted below:
No storage:
{ "data": [ { "field1": "1" } ], "columns": [ { "columnid": "field1", "dbtypeid": "STRING" } ], "xcolumns": { "field1": { "columnid": "field1", "dbtypeid": "STRING" } }, "inddefs": {}, "indices": {}, "uniqs": { "-2097186069": { "1": { "field1": "1" } } }, "uniqdefs": {}, "identities": {}, "checkfn": [], "checkfns": [], "beforeinsert": {}, "afterinsert": {}, "insteadofinsert": {}, "beforedelete": {}, "afterdelete": {}, "insteadofdelete": {}, "beforeupdate": {}, "afterupdate": {}, "insteadofupdate": {}, "pk": { "columns": [ "field1" ], "onrightfns": "r['field1']", "hh": -2097186069 }, "defaultfns": "", "onupdatefns": "", "dirty": true }Localstorage:
{ "data": [ { "field1": "1" }, { "field1": "1" } ], "columns": [ { "columnid": "field1", "dbtypeid": "STRING" } ], "xcolumns": { "field1": { "columnid": "field1", "dbtypeid": "STRING" } }, "inddefs": {}, "indices": {}, "uniqs": {}, "uniqdefs": {}, "identities": {}, "checkfn": [], "checkfns": [], "beforeinsert": {}, "afterinsert": {}, "insteadofinsert": {}, "beforedelete": {}, "afterdelete": {}, "insteadofdelete": {}, "beforeupdate": {}, "afterupdate": {}, "insteadofupdate": {} }nickdeis commentedon Jan 31, 2016
Related to #409 I think. Since the localStorage implementation serializes tables into localStorage, the unique constraint does not work.