From 69b358070d064922f785f479d44ee809abfc8024 Mon Sep 17 00:00:00 2001 From: makorne Date: Sun, 1 Dec 2024 12:05:47 +0700 Subject: [PATCH] Try to use enums --- example/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/src/main.rs b/example/src/main.rs index 2c16a4e..909d689 100644 --- a/example/src/main.rs +++ b/example/src/main.rs @@ -24,7 +24,7 @@ async fn main() -> Result<(), Box> { .execute(conn.schema()) .await?; - let test_user_info = UserInfo { + let test_user_info = UserRole { id: 13u64, name: "test".to_string(), age: 32u8, @@ -49,7 +49,7 @@ async fn main() -> Result<(), Box> { .execute(&pool) .await?; - let users: Vec = + let users: Vec = sqlx::query_as("SELECT * FROM test4 WHERE age > $age AND age < $arg_1") .bind(("age", 30)) .bind(40) @@ -74,7 +74,7 @@ pub enum UserRole { #[allow(unused)] #[derive(sqlx::FromRow)] -struct UserInfo { +struct UserRole { id: u64, name: String, age: u8,