You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to verify optional arguments for run() are passed/executed by the server #3477
Is there a way to figure out the optional arguments for run() are being passed and processed by the server successfully? For example r.table('marvel').run(conn, {noreply: true}, function (err, cursor) {...}); ? I am using lua drivers from https://github.com/grandquista/Lua-ReQL which is perfectly working, but I need to know if the optargs are really being passed to the server and parsed? Is there something equivalent to log all queries and their params?
Here's a really hacky way of making sure that an opt arg is getting processed by the server: r.table('marvel').insert({}).run(conn, {durability: r.error("durability processed")}, cb);
By setting an opt arg to r.error(msg) the query fails with msg as soon as the opt arg gets processed. Note that:
the error is only thrown if the opt arg is actually used by the query. For example the durability opt arg wouldn't be used by a read query, and hence wouldn't throw the error.
this might or might not work for noreply. noreply is special because it has to be handled partially on the client. Depending on how the client interprets the r.error() value, it might either reject the query, show no result at all, or break the connection.
There isn't a server-side query log yet, see #544 .
Activity
danielmewes commentedon Dec 30, 2014
Here's a really hacky way of making sure that an opt arg is getting processed by the server:
r.table('marvel').insert({}).run(conn, {durability: r.error("durability processed")}, cb);By setting an opt arg to
r.error(msg)the query fails withmsgas soon as the opt arg gets processed. Note that:durabilityopt arg wouldn't be used by a read query, and hence wouldn't throw the error.noreply.noreplyis special because it has to be handled partially on the client. Depending on how the client interprets ther.error()value, it might either reject the query, show no result at all, or break the connection.There isn't a server-side query log yet, see #544 .