Skip to content

Add support for NamedQueryRow#174

Open
proteneer wants to merge 12 commits intojmoiron:masterfrom
proteneer:master
Open

Add support for NamedQueryRow#174
proteneer wants to merge 12 commits intojmoiron:masterfrom
proteneer:master

Conversation

@proteneer
Copy link
Copy Markdown

We have functions:

QueryRowx(query string, args ...interface{}) *Row, which takes in a normal list of sql args, and returns a pointer to a single sqlx.Row

NamedQuery(query string, arg interface{}) (*Rows, error), which takes in a single struct, and returns a pointer to sqlx.Rows

This PR adds:
NamedQueryRow(query string, arg interface{}) *Row, which takes in a single struct, and returns a pointer to a single sqlx.Row

ottob added a commit to mindoktor/sqlx that referenced this pull request May 12, 2017
ottob added a commit to mindoktor/sqlx that referenced this pull request May 16, 2017
copied from jmoiron#174

fixed a panic when NamedQuery returns an error
@ottob
Copy link
Copy Markdown

ottob commented May 16, 2017

Thanks for doing this but NamedQueryRow will panic if NamedQuery returns an error, due to rows being nil.

Fixed version: mindoktor@ac79aba

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants