-
Notifications
You must be signed in to change notification settings - Fork 888
SQLite upsert does not work #1728
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
Comments
Still not working for me: -- name: UpsertUser :exec
INSERT INTO users (user_id, status)
VALUES (@userId, @newStatus)
ON CONFLICT (user_id)
DO UPDATE SET status = @updatedStatus;
Generated: const upsertUser = `-- name: UpsertUser :exec
INSERT INTO users (user_id, status)
VALUES (?1, ?2)
ON CONFLICT (user_id)
DO UPDATE SET status = @updatedStatus
`
type UpsertUserParams struct {
UserId string
NewStatus int64
}
func (q *Queries) UpsertUser(ctx context.Context, arg UpsertUserParams) error {
_, err := q.db.ExecContext(ctx, upsertUser, arg.UserId, arg.NewStatus)
return err
} The last arg is not being parsed. Tried updating sqlc as well: v1.26.0 |
Oh thank you @orisano ! Appreciate ya :) |
Still happening |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
Other
What happened?
SQLite upsert syntax is not working using the beta SQLite engine from the latest main branch.
Relevant log output
Database schema
SQL queries
Configuration
No response
Playground URL
No response
What operating system are you using?
Linux
What database engines are you using?
No response
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: