[Request] Ability to view query history
Closed this issue · 4 comments
aleclarson commented
It would be nice to see the query history while debugging.
There are two hooks I think would be useful.
// Called whenever a query is sent to RethinkDB.
r.on('query', function(debug_info) {})
// Called whenever a query has "first_error" or "errors" in its result.
r.on('error', function(error_info) {})
Extarys commented
Those two would be awesome indeed! Great idea!
marshall007 commented
@aleclarson one alternative is to open up a changefeed on the rethinkdb.jobs
table.
neumino commented
@marshall007's sugestion is a good one.
If you really need this to happen client side, I'm not 100% convinced this belongs in the driver since it's not really a low level thing. You can properly wrap the calls to run
, or hack something if it's just for debugging with
var f = r.expr('').__proto__.run;
r.expr('').__proto__.run = function(arguments) { console.log(this.toString()); f.apply(this, arguments) }
egoarka commented
@neumino thanks for solution, but for me it works with typescript in the following way:
// @ts-ignore
const f = r.expr('').__proto__.__proto__.run
// @ts-ignore
// @ts-nocheck
r.expr('').__proto__.__proto__.run = function(connect)
console.log(this.toString())
return f.apply(this, [connect])
}