{"action":"created","issue":{"url":"https://api.github.com/repos/cuberite/cuberite/issues/3427","repository_url":"https://api.github.com/repos/cuberite/cuberite","labels_url":"https://api.github.com/repos/cuberite/cuberite/issues/3427/labels{/name}","comments_url":"https://api.github.com/repos/cuberite/cuberite/issues/3427/comments","events_url":"https://api.github.com/repos/cuberite/cuberite/issues/3427/events","html_url":"https://github.com/cuberite/cuberite/issues/3427","id":188005123,"number":3427,"title":"Add SQL bindings to Lua API","user":{"login":"madmaxoft","id":4388386,"avatar_url":"https://avatars.githubusercontent.com/u/4388386?v=3","gravatar_id":"","url":"https://api.github.com/users/madmaxoft","html_url":"https://github.com/madmaxoft","followers_url":"https://api.github.com/users/madmaxoft/followers","following_url":"https://api.github.com/users/madmaxoft/following{/other_user}","gists_url":"https://api.github.com/users/madmaxoft/gists{/gist_id}","starred_url":"https://api.github.com/users/madmaxoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madmaxoft/subscriptions","organizations_url":"https://api.github.com/users/madmaxoft/orgs","repos_url":"https://api.github.com/users/madmaxoft/repos","events_url":"https://api.github.com/users/madmaxoft/events{/privacy}","received_events_url":"https://api.github.com/users/madmaxoft/received_events","type":"User","site_admin":false},"labels":[{"id":93447791,"url":"https://api.github.com/repos/cuberite/cuberite/labels/lua%20api","name":"lua api","color":"FF80FF","default":false},{"id":84811172,"url":"https://api.github.com/repos/cuberite/cuberite/labels/proposal","name":"proposal","color":"80FFFF","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-11-08T14:26:07Z","updated_at":"2016-12-02T00:51:35Z","closed_at":null,"body":"There are more and more requests to have SQL bindings available to the plugins.\r\n\r\nAlthough already solvable using LuaRocks (and possibly other Lua package managers), it would be much better to include the API already in Cuberite itself.\r\n\r\nIn my opinion the easiest way to do that would be to use ODBC - it is supported out of the box on Windows and is a single dependency on Linux. This would keep compilation easy, with only one additional dependency on Linux.\r\n\r\nAs for the API, the basic one should work about the same as the current SQLite API - open DB, prepare a statement, execute statement, iterate over results. However, since these DB engines may have a much higher lag than SQLite, it would be advisable to provide also asynchronous API - open DB, prepare a statement, schedule statement for execution, provide callback for the returned data. For this, Cuberite would need a scheduler thread(pool) onto which the SQL statements (and later possibly other stuff) could be scheduled."},"comment":{"url":"https://api.github.com/repos/cuberite/cuberite/issues/comments/264342014","html_url":"https://github.com/cuberite/cuberite/issues/3427#issuecomment-264342014","issue_url":"https://api.github.com/repos/cuberite/cuberite/issues/3427","id":264342014,"user":{"login":"yangm97","id":4412002,"avatar_url":"https://avatars.githubusercontent.com/u/4412002?v=3","gravatar_id":"","url":"https://api.github.com/users/yangm97","html_url":"https://github.com/yangm97","followers_url":"https://api.github.com/users/yangm97/followers","following_url":"https://api.github.com/users/yangm97/following{/other_user}","gists_url":"https://api.github.com/users/yangm97/gists{/gist_id}","starred_url":"https://api.github.com/users/yangm97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yangm97/subscriptions","organizations_url":"https://api.github.com/users/yangm97/orgs","repos_url":"https://api.github.com/users/yangm97/repos","events_url":"https://api.github.com/users/yangm97/events{/privacy}","received_events_url":"https://api.github.com/users/yangm97/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T00:51:35Z","updated_at":"2016-12-02T00:51:35Z","body":"@Cl1608Ho's comment reminded me bukkit has [something](http://wiki.bukkit.org/Bukkit.yml#database) like this but nobody actually uses. \r\nI do wonder: what went wrong, and how Cuberite's solution would be any different?"}}
{"actor":{"display_login":"yangm97"}}