sqlx
sqlx copied to clipboard
Add NamedQueryContext to Tx
This change adds the NamedQueryContext method on Transactions to match calls on the Database directly. This allows the use of DB
and Tx
objects more interchangeably in consuming codebases.
I totally recognize that this exact change has been proposed and many PRs with the addition have been submitted (#348 #373 #448) but they all lacked tests. This PR also includes those changes and hopefully resolves #447 .
Pull Request Test Coverage Report for Build 226
- 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage increased (+0.6%) to 74.511%
Totals | |
---|---|
Change from base Build 224: | 0.6% |
Covered Lines: | 1219 |
Relevant Lines: | 1636 |
💛 - Coveralls
Hi @jmoiron - I realized I submitted this without contributing to #447 - there may possibly be great reasons the other PRs I reference have not landed (not just the missing tests). If there's anything in addition I can contribute to help move this over the line I am more than happy to do so. Particularly if you have any strong contribution conditions I'd love to meet them and even write them up as a CONTRIBUTING
file.
Fixes #447.
@jmoiron please add this
would love to 1-up this as this would be immensely useful for my project!
Hi @BLuchterhand, I and @dlsniper have taken over the repo and have some changes we want to make that might make this change unnecessary. That being said, we need to review all these issues and PRs. We have not found time to do this yet, it is something we are trying to schedule.
Some of the APIs you will find in this package I want to add to sqlx.
https://github.com/ardanlabs/service/tree/master/business/data/sqldb
Obviously logging and OTEL would need to be ripped out. I haven't been able to focus on this just yet.
Hello @jmoiron may i ask if this can be merged? Really need this from years ago!