{"action":"created","comment":{"url":"https://api.github.com/repos/begriffs/postgrest/pulls/comments/40691713","id":40691713,"diff_hunk":"@@ -52,13 +52,17 @@ executable postgrest\n                      , mtl\n                      , cassava\n                      , jwt\n+                     , parsec\n+                     , errors\n+                     , bifunctors\n   hs-source-dirs:      src\n \n library\n   if flag(ci)\n     ghc-options:       -Wall -W -Werror\n   else\n-    ghc-options:       -Wall -W -O2\n+    -- ghc-options:       -Wall -W -O2\n+    ghc-options:       -Wall -W","path":"postgrest.cabal","position":15,"original_position":15,"commit_id":"94b1d2815c5ed9f195c62776cf12d6b74fa6dce6","original_commit_id":"94b1d2815c5ed9f195c62776cf12d6b74fa6dce6","user":{"login":"ruslantalpa","id":5537246,"avatar_url":"https://avatars.githubusercontent.com/u/5537246?v=3","gravatar_id":"","url":"https://api.github.com/users/ruslantalpa","html_url":"https://github.com/ruslantalpa","followers_url":"https://api.github.com/users/ruslantalpa/followers","following_url":"https://api.github.com/users/ruslantalpa/following{/other_user}","gists_url":"https://api.github.com/users/ruslantalpa/gists{/gist_id}","starred_url":"https://api.github.com/users/ruslantalpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruslantalpa/subscriptions","organizations_url":"https://api.github.com/users/ruslantalpa/orgs","repos_url":"https://api.github.com/users/ruslantalpa/repos","events_url":"https://api.github.com/users/ruslantalpa/events{/privacy}","received_events_url":"https://api.github.com/users/ruslantalpa/received_events","type":"User","site_admin":false},"body":"an oversight, removed it temporarily so that compile would go faster","created_at":"2015-09-29T16:04:31Z","updated_at":"2015-09-29T16:04:31Z","html_url":"https://github.com/begriffs/postgrest/pull/295#discussion_r40691713","pull_request_url":"https://api.github.com/repos/begriffs/postgrest/pulls/295","_links":{"self":{"href":"https://api.github.com/repos/begriffs/postgrest/pulls/comments/40691713"},"html":{"href":"https://github.com/begriffs/postgrest/pull/295#discussion_r40691713"},"pull_request":{"href":"https://api.github.com/repos/begriffs/postgrest/pulls/295"}}},"pull_request":{"url":"https://api.github.com/repos/begriffs/postgrest/pulls/295","id":46155310,"html_url":"https://github.com/begriffs/postgrest/pull/295","diff_url":"https://github.com/begriffs/postgrest/pull/295.diff","patch_url":"https://github.com/begriffs/postgrest/pull/295.patch","issue_url":"https://api.github.com/repos/begriffs/postgrest/issues/295","number":295,"state":"open","locked":false,"title":"Extend the capabilities of PostgREST #280","user":{"login":"ruslantalpa","id":5537246,"avatar_url":"https://avatars.githubusercontent.com/u/5537246?v=3","gravatar_id":"","url":"https://api.github.com/users/ruslantalpa","html_url":"https://github.com/ruslantalpa","followers_url":"https://api.github.com/users/ruslantalpa/followers","following_url":"https://api.github.com/users/ruslantalpa/following{/other_user}","gists_url":"https://api.github.com/users/ruslantalpa/gists{/gist_id}","starred_url":"https://api.github.com/users/ruslantalpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruslantalpa/subscriptions","organizations_url":"https://api.github.com/users/ruslantalpa/orgs","repos_url":"https://api.github.com/users/ruslantalpa/repos","events_url":"https://api.github.com/users/ruslantalpa/events{/privacy}","received_events_url":"https://api.github.com/users/ruslantalpa/received_events","type":"User","site_admin":false},"body":"![itsdone](https://cloud.githubusercontent.com/assets/5537246/10135940/4dcd5a8e-65fa-11e5-8291-ebadd6588559.jpg)\r\n\r\nAll tests passing (but not 100% ready for release).\r\nI created this pull request to start the conversation so others can take a look at it. This needs fresh  pair of eyes.\r\n\r\n**What currently works (i think) and how it was changed compared to prev version**\r\n* The db structure is read only once at startup\r\n* / and /table[OPTINS] use only cached info\r\n* PUT / PATCH also use cached db info\r\n* Foreign keys for views are also detected\r\n* As before you can do\r\n```\r\n?select=*, col1::text, col2->>jp, ...\r\n```\r\n* The major change is you can now include info from related tables (parents, children, many to many)\r\n```\r\n?select=*, child1(*), parent1(id, name), child2(*, subchild(*))\r\n```\r\n* To add \"filters\" for related tables you can do\r\n```\r\n?child.col=eq.1&child.subchild.col=eq.2\r\n```\r\n\r\n**What needs to be done**\r\n* There are no tests for requesting related items (i think someone else should write them)\r\n* When there is an error in parsing the request or generating the query (no relation) i simply output the text, this needs to be \"cast\" somehow to be handled by errResponse\r\n```\r\nApp.hs (81)\r\nLeft e -> return $ responseLBS status200 [(\"Content-Type\", \"text/plain\")] $ cs e\r\n```\r\n* Probably the code needs a bit of cleanup (formatting, indentation, rename some functions like allcolumns ...)\r\n\r\n\r\n\r\n\r\n","created_at":"2015-09-28T13:18:35Z","updated_at":"2015-09-29T16:04:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a8aa10aac446cb285014cfceae8033fff721315","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/begriffs/postgrest/pulls/295/commits","review_comments_url":"https://api.github.com/repos/begriffs/postgrest/pulls/295/comments","review_comment_url":"https://api.github.com/repos/begriffs/postgrest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/begriffs/postgrest/issues/295/comments","statuses_url":"https://api.github.com/repos/begriffs/postgrest/statuses/94b1d2815c5ed9f195c62776cf12d6b74fa6dce6","head":{"label":"ruslantalpa:master","ref":"master","sha":"94b1d2815c5ed9f195c62776cf12d6b74fa6dce6","user":{"login":"ruslantalpa","id":5537246,"avatar_url":"https://avatars.githubusercontent.com/u/5537246?v=3","gravatar_id":"","url":"https://api.github.com/users/ruslantalpa","html_url":"https://github.com/ruslantalpa","followers_url":"https://api.github.com/users/ruslantalpa/followers","following_url":"https://api.github.com/users/ruslantalpa/following{/other_user}","gists_url":"https://api.github.com/users/ruslantalpa/gists{/gist_id}","starred_url":"https://api.github.com/users/ruslantalpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruslantalpa/subscriptions","organizations_url":"https://api.github.com/users/ruslantalpa/orgs","repos_url":"https://api.github.com/users/ruslantalpa/repos","events_url":"https://api.github.com/users/ruslantalpa/events{/privacy}","received_events_url":"https://api.github.com/users/ruslantalpa/received_events","type":"User","site_admin":false},"repo":{"id":41722606,"name":"postgrest","full_name":"ruslantalpa/postgrest","owner":{"login":"ruslantalpa","id":5537246,"avatar_url":"https://avatars.githubusercontent.com/u/5537246?v=3","gravatar_id":"","url":"https://api.github.com/users/ruslantalpa","html_url":"https://github.com/ruslantalpa","followers_url":"https://api.github.com/users/ruslantalpa/followers","following_url":"https://api.github.com/users/ruslantalpa/following{/other_user}","gists_url":"https://api.github.com/users/ruslantalpa/gists{/gist_id}","starred_url":"https://api.github.com/users/ruslantalpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruslantalpa/subscriptions","organizations_url":"https://api.github.com/users/ruslantalpa/orgs","repos_url":"https://api.github.com/users/ruslantalpa/repos","events_url":"https://api.github.com/users/ruslantalpa/events{/privacy}","received_events_url":"https://api.github.com/users/ruslantalpa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ruslantalpa/postgrest","description":"REST API for any Postgres database","fork":true,"url":"https://api.github.com/repos/ruslantalpa/postgrest","forks_url":"https://api.github.com/repos/ruslantalpa/postgrest/forks","keys_url":"https://api.github.com/repos/ruslantalpa/postgrest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruslantalpa/postgrest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruslantalpa/postgrest/teams","hooks_url":"https://api.github.com/repos/ruslantalpa/postgrest/hooks","issue_events_url":"https://api.github.com/repos/ruslantalpa/postgrest/issues/events{/number}","events_url":"https://api.github.com/repos/ruslantalpa/postgrest/events","assignees_url":"https://api.github.com/repos/ruslantalpa/postgrest/assignees{/user}","branches_url":"https://api.github.com/repos/ruslantalpa/postgrest/branches{/branch}","tags_url":"https://api.github.com/repos/ruslantalpa/postgrest/tags","blobs_url":"https://api.github.com/repos/ruslantalpa/postgrest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruslantalpa/postgrest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruslantalpa/postgrest/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruslantalpa/postgrest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruslantalpa/postgrest/statuses/{sha}","languages_url":"https://api.github.com/repos/ruslantalpa/postgrest/languages","stargazers_url":"https://api.github.com/repos/ruslantalpa/postgrest/stargazers","contributors_url":"https://api.github.com/repos/ruslantalpa/postgrest/contributors","subscribers_url":"https://api.github.com/repos/ruslantalpa/postgrest/subscribers","subscription_url":"https://api.github.com/repos/ruslantalpa/postgrest/subscription","commits_url":"https://api.github.com/repos/ruslantalpa/postgrest/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruslantalpa/postgrest/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruslantalpa/postgrest/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruslantalpa/postgrest/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruslantalpa/postgrest/contents/{+path}","compare_url":"https://api.github.com/repos/ruslantalpa/postgrest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruslantalpa/postgrest/merges","archive_url":"https://api.github.com/repos/ruslantalpa/postgrest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruslantalpa/postgrest/downloads","issues_url":"https://api.github.com/repos/ruslantalpa/postgrest/issues{/number}","pulls_url":"https://api.github.com/repos/ruslantalpa/postgrest/pulls{/number}","milestones_url":"https://api.github.com/repos/ruslantalpa/postgrest/milestones{/number}","notifications_url":"https://api.github.com/repos/ruslantalpa/postgrest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruslantalpa/postgrest/labels{/name}","releases_url":"https://api.github.com/repos/ruslantalpa/postgrest/releases{/id}","created_at":"2015-09-01T07:03:44Z","updated_at":"2015-09-01T07:03:44Z","pushed_at":"2015-09-29T08:40:43Z","git_url":"git://github.com/ruslantalpa/postgrest.git","ssh_url":"git@github.com:ruslantalpa/postgrest.git","clone_url":"https://github.com/ruslantalpa/postgrest.git","svn_url":"https://github.com/ruslantalpa/postgrest","homepage":"","size":863,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"begriffs:master","ref":"master","sha":"29ae1bdefdd32514a9bba064fbd3a1725fbc9290","user":{"login":"begriffs","id":911911,"avatar_url":"https://avatars.githubusercontent.com/u/911911?v=3","gravatar_id":"","url":"https://api.github.com/users/begriffs","html_url":"https://github.com/begriffs","followers_url":"https://api.github.com/users/begriffs/followers","following_url":"https://api.github.com/users/begriffs/following{/other_user}","gists_url":"https://api.github.com/users/begriffs/gists{/gist_id}","starred_url":"https://api.github.com/users/begriffs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/begriffs/subscriptions","organizations_url":"https://api.github.com/users/begriffs/orgs","repos_url":"https://api.github.com/users/begriffs/repos","events_url":"https://api.github.com/users/begriffs/events{/privacy}","received_events_url":"https://api.github.com/users/begriffs/received_events","type":"User","site_admin":false},"repo":{"id":20787122,"name":"postgrest","full_name":"begriffs/postgrest","owner":{"login":"begriffs","id":911911,"avatar_url":"https://avatars.githubusercontent.com/u/911911?v=3","gravatar_id":"","url":"https://api.github.com/users/begriffs","html_url":"https://github.com/begriffs","followers_url":"https://api.github.com/users/begriffs/followers","following_url":"https://api.github.com/users/begriffs/following{/other_user}","gists_url":"https://api.github.com/users/begriffs/gists{/gist_id}","starred_url":"https://api.github.com/users/begriffs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/begriffs/subscriptions","organizations_url":"https://api.github.com/users/begriffs/orgs","repos_url":"https://api.github.com/users/begriffs/repos","events_url":"https://api.github.com/users/begriffs/events{/privacy}","received_events_url":"https://api.github.com/users/begriffs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/begriffs/postgrest","description":"REST API for any Postgres database","fork":false,"url":"https://api.github.com/repos/begriffs/postgrest","forks_url":"https://api.github.com/repos/begriffs/postgrest/forks","keys_url":"https://api.github.com/repos/begriffs/postgrest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/begriffs/postgrest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/begriffs/postgrest/teams","hooks_url":"https://api.github.com/repos/begriffs/postgrest/hooks","issue_events_url":"https://api.github.com/repos/begriffs/postgrest/issues/events{/number}","events_url":"https://api.github.com/repos/begriffs/postgrest/events","assignees_url":"https://api.github.com/repos/begriffs/postgrest/assignees{/user}","branches_url":"https://api.github.com/repos/begriffs/postgrest/branches{/branch}","tags_url":"https://api.github.com/repos/begriffs/postgrest/tags","blobs_url":"https://api.github.com/repos/begriffs/postgrest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/begriffs/postgrest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/begriffs/postgrest/git/refs{/sha}","trees_url":"https://api.github.com/repos/begriffs/postgrest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/begriffs/postgrest/statuses/{sha}","languages_url":"https://api.github.com/repos/begriffs/postgrest/languages","stargazers_url":"https://api.github.com/repos/begriffs/postgrest/stargazers","contributors_url":"https://api.github.com/repos/begriffs/postgrest/contributors","subscribers_url":"https://api.github.com/repos/begriffs/postgrest/subscribers","subscription_url":"https://api.github.com/repos/begriffs/postgrest/subscription","commits_url":"https://api.github.com/repos/begriffs/postgrest/commits{/sha}","git_commits_url":"https://api.github.com/repos/begriffs/postgrest/git/commits{/sha}","comments_url":"https://api.github.com/repos/begriffs/postgrest/comments{/number}","issue_comment_url":"https://api.github.com/repos/begriffs/postgrest/issues/comments{/number}","contents_url":"https://api.github.com/repos/begriffs/postgrest/contents/{+path}","compare_url":"https://api.github.com/repos/begriffs/postgrest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/begriffs/postgrest/merges","archive_url":"https://api.github.com/repos/begriffs/postgrest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/begriffs/postgrest/downloads","issues_url":"https://api.github.com/repos/begriffs/postgrest/issues{/number}","pulls_url":"https://api.github.com/repos/begriffs/postgrest/pulls{/number}","milestones_url":"https://api.github.com/repos/begriffs/postgrest/milestones{/number}","notifications_url":"https://api.github.com/repos/begriffs/postgrest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/begriffs/postgrest/labels{/name}","releases_url":"https://api.github.com/repos/begriffs/postgrest/releases{/id}","created_at":"2014-06-13T00:23:00Z","updated_at":"2015-09-29T12:37:40Z","pushed_at":"2015-09-29T15:54:47Z","git_url":"git://github.com/begriffs/postgrest.git","ssh_url":"git@github.com:begriffs/postgrest.git","clone_url":"https://github.com/begriffs/postgrest.git","svn_url":"https://github.com/begriffs/postgrest","homepage":"","size":3498,"stargazers_count":5548,"watchers_count":5548,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":166,"mirror_url":null,"open_issues_count":79,"forks":166,"open_issues":79,"watchers":5548,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/begriffs/postgrest/pulls/295"},"html":{"href":"https://github.com/begriffs/postgrest/pull/295"},"issue":{"href":"https://api.github.com/repos/begriffs/postgrest/issues/295"},"comments":{"href":"https://api.github.com/repos/begriffs/postgrest/issues/295/comments"},"review_comments":{"href":"https://api.github.com/repos/begriffs/postgrest/pulls/295/comments"},"review_comment":{"href":"https://api.github.com/repos/begriffs/postgrest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/begriffs/postgrest/pulls/295/commits"},"statuses":{"href":"https://api.github.com/repos/begriffs/postgrest/statuses/94b1d2815c5ed9f195c62776cf12d6b74fa6dce6"}}}}