{"action":"created","issue":{"url":"https://api.github.com/repos/agershun/alasql/issues/62","labels_url":"https://api.github.com/repos/agershun/alasql/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/agershun/alasql/issues/62/comments","events_url":"https://api.github.com/repos/agershun/alasql/issues/62/events","html_url":"https://github.com/agershun/alasql/issues/62","id":57731913,"number":62,"title":"Synchronous JSON ?","user":{"login":"fredt34","id":654412,"avatar_url":"https://avatars.githubusercontent.com/u/654412?v=3","gravatar_id":"","url":"https://api.github.com/users/fredt34","html_url":"https://github.com/fredt34","followers_url":"https://api.github.com/users/fredt34/followers","following_url":"https://api.github.com/users/fredt34/following{/other_user}","gists_url":"https://api.github.com/users/fredt34/gists{/gist_id}","starred_url":"https://api.github.com/users/fredt34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredt34/subscriptions","organizations_url":"https://api.github.com/users/fredt34/orgs","repos_url":"https://api.github.com/users/fredt34/repos","events_url":"https://api.github.com/users/fredt34/events{/privacy}","received_events_url":"https://api.github.com/users/fredt34/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/agershun/alasql/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-15T14:26:43Z","updated_at":"2015-08-21T19:36:49Z","closed_at":"2015-05-14T09:44:30Z","body":"Hi, \r\n\r\nBravo and Thanks for this amazing project - I really like the concept and I'm testing it to give our web application a new architecture.\r\n\r\nTo take an analogy with the classical Orders example:\r\n- I'd like to json-query  table \"Orders\"  from the server, \r\n- as \"Products\" and \"ProductCategories\" don't change much, I'd like to load them once on initialisation, then JOIN on them with \"Orders\"  (those quasi-static data may be updated later via a webworker polling for changes or a websocket).\r\n\r\nSo far the POC works well, I load data with something like:\r\n\r\n```javascript\r\nvar db = new alasql.Database(\"localdb\");\r\nalasql(\"USE DATABASE localdb\");\r\n\r\ndataAdrr = \"http://server/query.php?object=Products\";\r\ndataQuery = 'SELECT * FROM JSON(\"' + dataAddr + '\")';\r\nalasql(dataQuery,[],function(data) {\r\n        db.exec('CREATE TABLE Products');\r\n        db.tables.Products.data =  data;\r\n});\r\n```\r\nbut now I face the problem of asynchronicity of JSON : \r\n```javascript\r\nconsole.table (alasql(\"SELECT * from Products\") \r\n```\r\nreturns nothing, as the data are not yet received...\r\n\r\nThe POC should show if we can load about 20 such tables, and perform locally the complex queries with multiple JOINS, subselects, groups... which we currently have on the php server. \r\n\r\nIf the POC succeeds, we'll probably use Promises, Then, Resolve... to handle this asynchronicity, but is there is trick I can use right now to run JSON queries synchronously, something like \"async: false\" in previous jQuery versions ?\r\n\r\nThanks in advance !"},"comment":{"url":"https://api.github.com/repos/agershun/alasql/issues/comments/133539055","html_url":"https://github.com/agershun/alasql/issues/62#issuecomment-133539055","issue_url":"https://api.github.com/repos/agershun/alasql/issues/62","id":133539055,"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":"2015-08-21T19:36:49Z","updated_at":"2015-08-21T19:36:49Z","body":"@dmvianna It is present in 0.2.0"}}