Query Event 8.6 not triggering like before #855
Comments
It seems to have broken between 0.7.6 -> 0.8.0 |
Ah, yep transactions got a big internal overhaul and I think I forgot to proxy the events on the "transaction" client back through to the original client. Also, are you saying that you're using the event to mutate the object passed to the event, modifying the sql before it goes into the query? If so I might need to change else to support this behavior. |
@tgriesser Ah, I see, thanks for the quick reply. I'll stay 7.6 for now and wait for fix. :) And yes, that's what's being done. The sql property of the data object gets manipulated by adding the SchemaName to all relevant places of the query through a regex. This is done because I saw no other (or better) way of doing it. Example: db('Year').select().toString()
select * from "Year" <--- Event ---> select * from "MySchema"."Year" |
In that case you should be able to do |
Surprisingly, that did work.. I recall having tried that before and received "MySchema.Year" instead of "MySchema"."Year" which is the original cause opting for the query event. I'll keep that in mind, might make life easier. |
Hey.
Updated my knex package from 7.6 -> 8.6 (big leap, I know). By doing so, it appears the Query Event is not being triggered as it used to. Is this something you're aware of?
Example code:
Everything is run through transactions (if that matters?). We're very dependant on this event as we append SchemaName (Postgres) to the queries.
I couldn't find anything relating to this in the changelog, but please do correct me if I missed it.
Thanks in advance.
The text was updated successfully, but these errors were encountered: