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
I realise it's possible to do this with access to the db. But it would be useful, especially when debugging performance to be able to get the raw queries logged.
ie
db =DB.open(ENV["DATABASE_URL"])
db.logger =->mylogger(String)
db.logging =true# do some stuff
db.logging =falsedefmylogger(sql : String)
puts"#{Time.new}#{sql}"end
I could imagine using this to get all the queries used on a single request. Though I'm unsure if this would work with the async nature of how queries are handled. I'll happily give this a go if anyone else thinks this is feasible.
The text was updated successfully, but these errors were encountered:
In terms of running a log command - does anyone know if there is a better place than this to grab the sql string for each request other than this ? I've chucked a puts @query in there and it seems to work. It doesn't have any arguments inserted, but it's not a bad first step.
I realise it's possible to do this with access to the db. But it would be useful, especially when debugging performance to be able to get the raw queries logged.
ie
I could imagine using this to get all the queries used on a single request. Though I'm unsure if this would work with the async nature of how queries are handled. I'll happily give this a go if anyone else thinks this is feasible.
The text was updated successfully, but these errors were encountered: