Skip to content

UPDATE query_as! with a custom ENUM type (syntax) #3041

Closed Answered by RAprogramm
RAprogramm asked this question in Q&A
Discussion options

You must be logged in to vote

YES!
Here is right query syntax

r#"UPDATE users SET role=($1::text)::user_role, updated_at=$2 WHERE id=$3 RETURNING id, name, email, verified, created_at, password, updated_at, role as "role:UserRole""#,

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RAprogramm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant