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 use a configuration parameter in my transactions that triggers reference during row mutation, for the purpose of keeping a journal on who made changes to the database. I had this working fine in Knex 0.5.x but it fails in Knex 0.6.x -- the configuration parameter is not available to the trigger.
Knex 0.5.x example (working):
knex.transaction (t) ->
t.connection.query "SET LOCAL app.session = '#{req.token}'"
knex 'session'
.transacting t
.insert!
Knex 0.6.x example (not working):
knex.transaction (t) ->
t.raw "SET LOCAL app.session = '#{req.token}'"
.then ->
t 'session'
.insert!
Knex 0.6.x alternative example (not working either):
knex.transaction (t) ->
t.raw "SET LOCAL app.session = '#{req.token}'"
.then ->
knex 'session'
.transacting t
.insert!
The text was updated successfully, but these errors were encountered:
Still need to cut the patch release, but that one line should fix it for the time being. I was looking to add some tests and realized I need to do a bit more work internally to ensure events are handled within transactions properly. I'll try to get a patch release out by the end of the day regardless.
I use a configuration parameter in my transactions that triggers reference during row mutation, for the purpose of keeping a journal on who made changes to the database. I had this working fine in Knex 0.5.x but it fails in Knex 0.6.x -- the configuration parameter is not available to the trigger.
Knex 0.5.x example (working):
Knex 0.6.x example (not working):
Knex 0.6.x alternative example (not working either):
The text was updated successfully, but these errors were encountered: