Skip to content

Conversation

@ihatov08
Copy link
Contributor

I got an error when I followed the documentation.

db/query/user.sql:49:1: query "UpdateUser" specifies parameter ":one" without containing a RETURNING clause

db/query/user.sql

-- name: UpdateUser :one
UPDATE users
SET
  name = coalesce(sqlc.narg('name'), name),
  email = coalesce(sqlc.narg('email'), email),
  role = coalesce(sqlc.narg('role'), role),
  bio = coalesce(sqlc.narg('bio'), bio),
  hashed_password = coalesce(sqlc.narg('hashed_password'), hashed_password)
WHERE id = sqlc.arg('id');

I added RETURNING to avoid errors.

sqlc version
1.17.2

@kyleconroy kyleconroy merged commit 7e6c137 into sqlc-dev:main Apr 7, 2023
alfonsodev pushed a commit to ExponentiaTeam/sqlc that referenced this pull request Oct 13, 2025
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