You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pubasyncfnwith_roles(&self,state:&AppState) -> Result<()>{let pool = state.pool.clone();let sql = r#" SELECT users.* , Arr_AGG(roles.*) AS roles FROM users JOIN users_roles ON users_roles.user_uid = users.uid JOIN roles ON roles.uid = users_roles.role_uid WHERE users.uid = $1 GROUP BY users.uid "#;let conn = pool.get().await.unwrap();// use the connection// it will be returned to the pool when it falls out of scope.let rows = conn.query(sql,&[&self.uid]).await.unwrap();// let value: &str = rows[0].get(0);Ok(())}
I'm getting array from postgres
I get Vec it as array
I want to convert it to Vec<Role> ?
How to implemt
FromSql
trait for type likeRole
The text was updated successfully, but these errors were encountered: