{"action":"created","issue":{"url":"https://api.github.com/repos/begriffs/postgrest/issues/114","labels_url":"https://api.github.com/repos/begriffs/postgrest/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/begriffs/postgrest/issues/114/comments","events_url":"https://api.github.com/repos/begriffs/postgrest/issues/114/events","html_url":"https://github.com/begriffs/postgrest/issues/114","id":53183567,"number":114,"title":"Expose stored procedures ","user":{"login":"alexpdp7","id":1150630,"avatar_url":"https://avatars.githubusercontent.com/u/1150630?v=3","gravatar_id":"","url":"https://api.github.com/users/alexpdp7","html_url":"https://github.com/alexpdp7","followers_url":"https://api.github.com/users/alexpdp7/followers","following_url":"https://api.github.com/users/alexpdp7/following{/other_user}","gists_url":"https://api.github.com/users/alexpdp7/gists{/gist_id}","starred_url":"https://api.github.com/users/alexpdp7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexpdp7/subscriptions","organizations_url":"https://api.github.com/users/alexpdp7/orgs","repos_url":"https://api.github.com/users/alexpdp7/repos","events_url":"https://api.github.com/users/alexpdp7/events{/privacy}","received_events_url":"https://api.github.com/users/alexpdp7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-12-31T13:18:37Z","updated_at":"2015-04-26T01:29:50Z","closed_at":null,"body":"There's stuff that cannot be done well through views, such as a full text search. Stored procedures are not very RESTful, but I think it would be useful. "},"comment":{"url":"https://api.github.com/repos/begriffs/postgrest/issues/comments/96302049","html_url":"https://github.com/begriffs/postgrest/issues/114#issuecomment-96302049","issue_url":"https://api.github.com/repos/begriffs/postgrest/issues/114","id":96302049,"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},"created_at":"2015-04-26T01:29:50Z","updated_at":"2015-04-26T01:29:50Z","body":"Here's a proposal: expose each stored procedure in `/rpc/proc_name` and make them each accept only the post verb with json objects. It would would use the keys and values to call the procedure using [named notation](http://www.postgresql.org/docs/9.4/static/sql-syntax-calling-funcs.html#SQL-SYNTAX-CALLING-FUNCS-NAMED). Query params would be free to work as they do for views/tables, by filtering rows if the procedure generates a table-like output.\r\n\r\nSo why the `/rpc` prefix?  One reason is to avoid name collisions between views and procedures. It also helps emphasize to API consumers that these functions are not normal restful things. The functions can have arbitrary and surprising behavior, not the standard \"post creates a resource\" thing that users expect from the other routes.\r\n\r\nI am considering allowing GET requests for functions that are marked non-volatile but then how do we pass in parameters? It seems nicer to always send params in the same way (through a post body).\r\n\r\nAny thoughts before I jump in and start coding?"}}