Skip to content

Commit

Permalink
Try to use enums
Browse files Browse the repository at this point in the history
  • Loading branch information
makorne authored Dec 1, 2024
1 parent 0a3ad4d commit 69b3580
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.execute(conn.schema())
.await?;

let test_user_info = UserInfo {
let test_user_info = UserRole {
id: 13u64,
name: "test".to_string(),
age: 32u8,
Expand All @@ -49,7 +49,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.execute(&pool)
.await?;

let users: Vec<UserInfo> =
let users: Vec<UserRole> =
sqlx::query_as("SELECT * FROM test4 WHERE age > $age AND age < $arg_1")
.bind(("age", 30))
.bind(40)
Expand All @@ -74,7 +74,7 @@ pub enum UserRole {

#[allow(unused)]
#[derive(sqlx::FromRow)]
struct UserInfo {
struct UserRole {
id: u64,
name: String,
age: u8,
Expand Down

0 comments on commit 69b3580

Please sign in to comment.