zapatos
zapatos copied to clipboard
Feature request: Allow supplying different config per query
Currently in order to set config you need to call setConfig
, which will affect all queries.
I currently use queryListener
, resultListener
and transactionListener
in order to log requests, but I would like to be able to log with context (request id, user id, etc). This isn't possible as I have to use the same logging setup across queries.
Ideally I'd be able to create multiple instances of Zapatos - one per query (which shouldn't be a performance problem as I can use the same pool across them?), but this isn't possible as there is one global "instance".
I'd also settle for just being able to supply the config to all request functions, this would be a little less clean but still workable.
I'd be interested to hear your thoughts. Thanks!