Skip to content

Add NamedQueryContext to Tx#724

Open
daveworth wants to merge 1 commit intojmoiron:masterfrom
daveworth:dw/add-tx-namedquerycontext
Open

Add NamedQueryContext to Tx#724
daveworth wants to merge 1 commit intojmoiron:masterfrom
daveworth:dw/add-tx-namedquerycontext

Conversation

@daveworth
Copy link
Copy Markdown

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 .

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.
@coveralls
Copy link
Copy Markdown

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 Coverage Status
Change from base Build 224: 0.6%
Covered Lines: 1219
Relevant Lines: 1636

💛 - Coveralls

@daveworth
Copy link
Copy Markdown
Author

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.

@walles
Copy link
Copy Markdown

walles commented Dec 22, 2021

Fixes #447.

@s-mang
Copy link
Copy Markdown

s-mang commented Dec 20, 2022

@jmoiron please add this

@BLuchterhand
Copy link
Copy Markdown

would love to 1-up this as this would be immensely useful for my project!

@ardan-bkennedy
Copy link
Copy Markdown
Collaborator

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.

@dlsniper dlsniper added the could merge The PR look safe enough to merge label Feb 1, 2024
@nicandcranny
Copy link
Copy Markdown

Hello @jmoiron may i ask if this can be merged? Really need this from years ago!

Copy link
Copy Markdown

@joonas joonas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Lets land this thing! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

could merge The PR look safe enough to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing NamedQueryContext on *sqlx.Tx

10 participants