{"action":"created","issue":{"url":"https://api.github.com/repos/agershun/alasql/issues/774","repository_url":"https://api.github.com/repos/agershun/alasql","labels_url":"https://api.github.com/repos/agershun/alasql/issues/774/labels{/name}","comments_url":"https://api.github.com/repos/agershun/alasql/issues/774/comments","events_url":"https://api.github.com/repos/agershun/alasql/issues/774/events","html_url":"https://github.com/agershun/alasql/issues/774","id":184635815,"number":774,"title":"Bug in localStorage when editing table.data directly","user":{"login":"michaellee8","id":16556558,"avatar_url":"https://avatars.githubusercontent.com/u/16556558?v=3","gravatar_id":"","url":"https://api.github.com/users/michaellee8","html_url":"https://github.com/michaellee8","followers_url":"https://api.github.com/users/michaellee8/followers","following_url":"https://api.github.com/users/michaellee8/following{/other_user}","gists_url":"https://api.github.com/users/michaellee8/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellee8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellee8/subscriptions","organizations_url":"https://api.github.com/users/michaellee8/orgs","repos_url":"https://api.github.com/users/michaellee8/repos","events_url":"https://api.github.com/users/michaellee8/events{/privacy}","received_events_url":"https://api.github.com/users/michaellee8/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/agershun/alasql/labels/!%20Bug","name":"! Bug","color":"fc2929"},{"url":"https://api.github.com/repos/agershun/alasql/labels/Bug:%20Code%20provided%20to%20reproduced","name":"Bug: Code provided to reproduced","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-22T15:16:33Z","updated_at":"2016-10-24T08:15:12Z","closed_at":null,"body":"I created a database with `alasql` and applied my desired testing data with it by `mydb.tables.mytable.data` perfectly. However, something strange exists when I try to store it with `localStorage`\r\n\r\nproviding the javascript here : \r\n```javascript\r\nalasql('CREATE localStorage DATABASE IF NOT EXISTS lsdb');\r\nalasql('ATTACH localStorage DATABASE lsdb AS db');\r\nvar db = alasql.Database('db');\r\ndb.exec('CREATE TABLE IF NOT EXISTS db_01 (foo STRING)');\r\ndb.tables.db_01.data = [{\r\n  foo: \"text_foo\"\r\n}];\r\ndocument.getElementById('output').innerHTML += JSON.stringify(db.tables.db_01.data) + '<br/>';\r\ndocument.getElementById('output').innerHTML += localStorage.getItem('lsdb.db_01')+ '<br/>';\r\ndocument.getElementById('output').innerHTML += JSON.stringify(db.exec('SELECT * FROM db_01')) + '<br/>';\r\ndocument.getElementById('output').innerHTML += JSON.stringify(db.tables.db_01.data) + '<br/>';\r\n```\r\n\r\nfiddle : [alasql_localStorage_bug](https://jsfiddle.net/ckmichael8/657b6xLq/)\r\n\r\nAttached is a full HTML page to reproduce the problem, but with a extension .txt since github don't support HTML uploading\r\n[alasql_localStorage_bug.txt](https://github.com/agershun/alasql/files/545853/alasql_localStorage_bug.txt)\r\n\r\nEDIT: PS: currently I can only do things properly by creating a normal `DATABASE` and then save it to localStorage by `JSON.stringify(db.tables.db_01.data)`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/agershun/alasql/issues/comments/255676037","html_url":"https://github.com/agershun/alasql/issues/774#issuecomment-255676037","issue_url":"https://api.github.com/repos/agershun/alasql/issues/774","id":255676037,"user":{"login":"mathiasrw","id":1063454,"avatar_url":"https://avatars.githubusercontent.com/u/1063454?v=3","gravatar_id":"","url":"https://api.github.com/users/mathiasrw","html_url":"https://github.com/mathiasrw","followers_url":"https://api.github.com/users/mathiasrw/followers","following_url":"https://api.github.com/users/mathiasrw/following{/other_user}","gists_url":"https://api.github.com/users/mathiasrw/gists{/gist_id}","starred_url":"https://api.github.com/users/mathiasrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathiasrw/subscriptions","organizations_url":"https://api.github.com/users/mathiasrw/orgs","repos_url":"https://api.github.com/users/mathiasrw/repos","events_url":"https://api.github.com/users/mathiasrw/events{/privacy}","received_events_url":"https://api.github.com/users/mathiasrw/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T08:15:12Z","updated_at":"2016-10-24T08:15:12Z","body":"Thanks for taking the time to identify this..."}}
{"actor":{"display_login":"mathiasrw"}}