//go:build postgres // Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.30.0 // source: profile.sql package pgdbgen import ( "context" ) const updateUserPassword = `-- name: UpdateUserPassword :exec UPDATE users SET password = $1 WHERE id = $2 ` type UpdateUserPasswordParams struct { Password string `json:"password"` ID int64 `json:"id"` } func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error { _, err := q.db.Exec(ctx, updateUserPassword, arg.Password, arg.ID) return err } const updateUserProfile = `-- name: UpdateUserProfile :execrows UPDATE users SET username = $1, avatar = $2 WHERE id = $3 ` type UpdateUserProfileParams struct { Username string `json:"username"` Avatar *string `json:"avatar"` ID int64 `json:"id"` } // PostgreSQL variants of the sqlite profile queries. // UpdateUserProfile uses :execrows because postgres has no LastInsertId; // the caller checks rows-affected for existence. func (q *Queries) UpdateUserProfile(ctx context.Context, arg UpdateUserProfileParams) (int64, error) { result, err := q.db.Exec(ctx, updateUserProfile, arg.Username, arg.Avatar, arg.ID) if err != nil { return 0, err } return result.RowsAffected(), nil }