Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crud: false NoRows error returned if other error occurs #3

Open
muhlemmer opened this issue Jan 17, 2022 · 0 comments
Open

crud: false NoRows error returned if other error occurs #3

muhlemmer opened this issue Jan 17, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@muhlemmer
Copy link
Owner

record, err = pbpgx.QueryRow[Record](ctx, x, qs, args...)

Executing the INSERT...RETURNING query which fails to insert, the returned error is pgx.ErrNoRows, while it should be the original error:

6:27PM ERR Query args=[{"ValueTranscoder":"muhlemmer"},{"ValueTranscoder":"[email protected]"}] err="ERROR: duplicate key value violates unique constraint \"users_email_key\" (SQLSTATE 23505)" module=pgx pid=373 sql="INSERT INTO \"account\".\"users\" (\"nickname\", \"email\") VALUES ($1, $2) RETURNING \"email\", \"nickname\", \"updated_at\", \"created_at\", \"id\";"
panic: Table "account"."users" Create[0]: no rows in result set
@muhlemmer muhlemmer self-assigned this Jan 17, 2022
@muhlemmer muhlemmer added the bug Something isn't working label Jan 17, 2022
@muhlemmer muhlemmer removed their assignment Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant