sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Added NamedSelect and NamedGet APIs

Open prasad83 opened this issue 5 years ago • 5 comments

NamedSelect and NamedGet APIs to be consistent with Select and Get variants were missing.

Kindly consider this merge request.

prasad83 avatar Mar 04 '20 14:03 prasad83

Pull Request Test Coverage Report for Build 135

  • 0 of 26 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.2%) to 66.578%

Changes Missing Coverage Covered Lines Changed/Added Lines %
sqlx.go 0 9 0.0%
named.go 0 17 0.0%
<!-- Total: 0 26
Totals Coverage Status
Change from base Build 122: -1.2%
Covered Lines: 1000
Relevant Lines: 1502

💛 - Coveralls

coveralls avatar Mar 04 '20 14:03 coveralls

Is there any chance for this PR to be reviewed? It would be really useful to have these as part of sqlx API.

adamantike avatar Sep 23 '22 14:09 adamantike

Is sqlx no longer maintained, or is this pull request just waiting for test coverage to be implemented?

Would be a useful addition, the sqlx API is a little inconsistent without it

carpii avatar Nov 10 '22 22:11 carpii

Is sqlx no longer maintained, or is this pull request just waiting for test coverage to be implemented?

I hope the second. Could you add test?

Also, there is Named Queries in doc with an example.

arg := map[string]interface{}{
    "published": true,
    "authors": []{8, 19, 32, 44},
}
query, args, err := sqlx.Named("SELECT * FROM articles WHERE published=:published AND author_id IN (:authors)", arg)
query, args, err := sqlx.In(query, args...)
query = db.Rebind(query)
db.Query(query, args...)

maranqz avatar Nov 23 '22 15:11 maranqz

Hello, @ardan-bkennedy, and I recently stepped in to help maintain this project. We are sorting the opened issues and pull requests and would like to know if you still NEED this merged. If so, can you please add tests to it? Thank you for your contribution.

dlsniper avatar Feb 01 '24 14:02 dlsniper