Skip to content

HOW TO MAKE UPDATE QUERY??? query_as! UPDATE ... SET ...RETURNING...(unsupported type user_role for param #1) #3044

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 2 replies

Comment options

You must be logged in to vote
2 replies
@AlexandreCassagne
Comment options

@AlexandreCassagne
Comment options

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
2 participants