Closed vellotis closed 8 years ago
Sadly suggested solution seems to be valid only for v.0.10.x versions. Have to investigate further for solution for older knex versions.
@vellotis thank you for your contributions I am traveling until the 14th but will have a look at it all then :)
If you have time to run the release/0.3.3
branch the query object now has a transacting
parameter unfortunately we cannot differentiate between different transactions.
Thanks @jbrumwell
It would be great if transaction context for query could be accessed through tracker event.
The query dialect client has a instance property
txid
if transaction is used. This can be accessed the same way byquery
mock.I would implement it and do a PR, but what would be the best practise to implement it? Set it as tracker emitted
query
argument property, property of its options proeprty or as an additional event emit argument? I think the last one would be suitable as thequery
argument is returned by promise. So the new signature fortrack
method would beAnd the client
query
method must be something like thisand knex
_query
method must be something like thisAs a result the query context trx could be accessible this way:
Is it considerable? BR