{"action":"created","issue":{"url":"https://api.github.com/repos/sqlectron/sqlectron-core/issues/15","repository_url":"https://api.github.com/repos/sqlectron/sqlectron-core","labels_url":"https://api.github.com/repos/sqlectron/sqlectron-core/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/sqlectron/sqlectron-core/issues/15/comments","events_url":"https://api.github.com/repos/sqlectron/sqlectron-core/issues/15/events","html_url":"https://github.com/sqlectron/sqlectron-core/pull/15","id":152748242,"number":15,"title":"#125 Objects SQL definition","user":{"login":"BornaP","id":8470710,"avatar_url":"https://avatars.githubusercontent.com/u/8470710?v=3","gravatar_id":"","url":"https://api.github.com/users/BornaP","html_url":"https://github.com/BornaP","followers_url":"https://api.github.com/users/BornaP/followers","following_url":"https://api.github.com/users/BornaP/following{/other_user}","gists_url":"https://api.github.com/users/BornaP/gists{/gist_id}","starred_url":"https://api.github.com/users/BornaP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BornaP/subscriptions","organizations_url":"https://api.github.com/users/BornaP/orgs","repos_url":"https://api.github.com/users/BornaP/repos","events_url":"https://api.github.com/users/BornaP/events{/privacy}","received_events_url":"https://api.github.com/users/BornaP/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-03T11:02:23Z","updated_at":"2016-05-05T10:05:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sqlectron/sqlectron-core/pulls/15","html_url":"https://github.com/sqlectron/sqlectron-core/pull/15","diff_url":"https://github.com/sqlectron/sqlectron-core/pull/15.diff","patch_url":"https://github.com/sqlectron/sqlectron-core/pull/15.patch"},"body":"PR based on [this issue](https://github.com/sqlectron/sqlectron-gui/issues/125).\r\n\r\nThis is still a working version. PR is opened for further discussion. Here's what's implemented:\r\n\r\n- Routines (procedures/functions) SQL definition can now be retrieved from store.routines object (for example on user double clicking routine, it's definition could be previewed in SQL editor tab) - resolved with 839622d1dde619c7dbfe0e2a19efd499f2ff2c46\r\n\r\n- Create table script can be fetched from database API with `getTableCreateScript` method. While it was trivial to implement this for MySQL, I reused (and slightly redefined) SQL scripts found on stackoverflow (links [PostgreSQL](https://github.com/BornaP/sqlectron-core/commit/824d06c5ed3e1c620026aee03232c7544032fd0c#diff-1e8257a7827404852fd1dfe42e66dfc1R182), [SQL Server](https://github.com/BornaP/sqlectron-core/commit/bc4f8bf02691cba03334fcd639785487cd6f0cf9#diff-475fc021358a11bff3172976a96ac2abR130)).\r\n\r\nNow, similar can be done for Views (in fact it's the same function for MySQL). But what I had also in mind is having context menu (on right clicking a table) with SELECT/INSERT/UPDATE/DELETE scripts, similar to pgAdmin:\r\n\r\n![sql_scripts](https://cloud.githubusercontent.com/assets/8470710/14981292/69f38118-112e-11e6-9acf-e00e9b1d7c6b.png)\r\n\r\nAt first I thought about including this to back-end, but on the second thought, these are entirely the same for each DB server since that's a SQL standard. So maybe generating scripts logic could be included directly in sqlectron-gui or in one method that returns object containing this script's for specified table. If we will choose second option I'll implement it in this same PR."},"comment":{"url":"https://api.github.com/repos/sqlectron/sqlectron-core/issues/comments/217117091","html_url":"https://github.com/sqlectron/sqlectron-core/pull/15#issuecomment-217117091","issue_url":"https://api.github.com/repos/sqlectron/sqlectron-core/issues/15","id":217117091,"user":{"login":"BornaP","id":8470710,"avatar_url":"https://avatars.githubusercontent.com/u/8470710?v=3","gravatar_id":"","url":"https://api.github.com/users/BornaP","html_url":"https://github.com/BornaP","followers_url":"https://api.github.com/users/BornaP/followers","following_url":"https://api.github.com/users/BornaP/following{/other_user}","gists_url":"https://api.github.com/users/BornaP/gists{/gist_id}","starred_url":"https://api.github.com/users/BornaP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BornaP/subscriptions","organizations_url":"https://api.github.com/users/BornaP/orgs","repos_url":"https://api.github.com/users/BornaP/repos","events_url":"https://api.github.com/users/BornaP/events{/privacy}","received_events_url":"https://api.github.com/users/BornaP/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T10:05:24Z","updated_at":"2016-05-05T10:05:24Z","body":"Everything runs smoothly now! :smile: I'll leave it up to you @maxcnunes to check it all once again and merge it into master. "}}