{"action":"created","issue":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3636","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3636/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3636/comments","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3636/events","html_url":"https://github.com/rethinkdb/rethinkdb/issues/3636","id":55100147,"number":3636,"title":"New pseudo type for ReQL queries in ReQL","user":{"login":"gchpaco","id":17789,"avatar_url":"https://avatars.githubusercontent.com/u/17789?v=3","gravatar_id":"","url":"https://api.github.com/users/gchpaco","html_url":"https://github.com/gchpaco","followers_url":"https://api.github.com/users/gchpaco/followers","following_url":"https://api.github.com/users/gchpaco/following{/other_user}","gists_url":"https://api.github.com/users/gchpaco/gists{/gist_id}","starred_url":"https://api.github.com/users/gchpaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gchpaco/subscriptions","organizations_url":"https://api.github.com/users/gchpaco/orgs","repos_url":"https://api.github.com/users/gchpaco/repos","events_url":"https://api.github.com/users/gchpaco/events{/privacy}","received_events_url":"https://api.github.com/users/gchpaco/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels/tp:RQL_proposal","name":"tp:RQL_proposal","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/91","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/91/labels","id":957659,"number":91,"title":"2.0-polish","description":null,"creator":{"login":"danielmewes","id":505365,"avatar_url":"https://avatars.githubusercontent.com/u/505365?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmewes","html_url":"https://github.com/danielmewes","followers_url":"https://api.github.com/users/danielmewes/followers","following_url":"https://api.github.com/users/danielmewes/following{/other_user}","gists_url":"https://api.github.com/users/danielmewes/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmewes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmewes/subscriptions","organizations_url":"https://api.github.com/users/danielmewes/orgs","repos_url":"https://api.github.com/users/danielmewes/repos","events_url":"https://api.github.com/users/danielmewes/events{/privacy}","received_events_url":"https://api.github.com/users/danielmewes/received_events","type":"User","site_admin":false},"open_issues":49,"closed_issues":0,"state":"open","created_at":"2015-01-30T01:02:11Z","updated_at":"2015-02-03T23:44:52Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-01-22T00:54:08Z","updated_at":"2015-02-04T00:15:45Z","closed_at":null,"body":"For purposes such as the `jobs` table (#3115, #3231) and a slow query log (#2238), it's necessary to display ReQL queries in a form comprehensible to the end user.  This is tricky because of the official drivers no two agree on nontrivial syntax, and they all contain some sort of kludge (keyword arguments, camel casing, operator overloading in JS; the limitations of `lambda` in Python; and Ruby of course is written in Ruby and the block syntax doesn't translate well).\r\n\r\nI propose here a new pseudo-type `REQL_QUERY`, whose payload is the JSON form of the original query.  The drivers can then translate the query into whatever is appropriate for their target language.  This would also help things like the web UI make better HTML-ified query printing, since the whole AST is available.\r\n\r\nAt this time I do not want to add `r.eval()` per #1863, although that's an obvious extension after the pseudo-type exists.\r\n"},"comment":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/comments/72765270","html_url":"https://github.com/rethinkdb/rethinkdb/issues/3636#issuecomment-72765270","issue_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3636","id":72765270,"user":{"login":"mlucy","id":1777134,"avatar_url":"https://avatars.githubusercontent.com/u/1777134?v=3","gravatar_id":"","url":"https://api.github.com/users/mlucy","html_url":"https://github.com/mlucy","followers_url":"https://api.github.com/users/mlucy/followers","following_url":"https://api.github.com/users/mlucy/following{/other_user}","gists_url":"https://api.github.com/users/mlucy/gists{/gist_id}","starred_url":"https://api.github.com/users/mlucy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlucy/subscriptions","organizations_url":"https://api.github.com/users/mlucy/orgs","repos_url":"https://api.github.com/users/mlucy/repos","events_url":"https://api.github.com/users/mlucy/events{/privacy}","received_events_url":"https://api.github.com/users/mlucy/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T00:15:45Z","updated_at":"2015-02-04T00:15:45Z","body":"I think we all basically agree on this.  I'd be OK always including the pretty-printed string.  (Also, I think we already talked about this, but the `REQL_QUERY` pseudotype should contain the ReQL version as well as the JSON representation of the query."}}