-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
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).
I 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.
At this time I do not want to add r.eval() per #1863, although that's an obvious extension after the pseudo-type exists.