diff --git a/src/main.rs b/src/main.rs index 4233a2d..f0fa7f7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,7 +40,7 @@ async fn main() -> Result<(), Box> { sqlite::load_template(&sqlite_connection).await?; sqlite::add_test_user(&sqlite_connection).await?; - println!("{}" ,sqlite::sqlite_out(&sqlite_connection, "SELECT * FROM users;", 1).await?); + println!("{}" ,sqlite_out(&sqlite_connection, "SELECT * FROM users;", 1).await?); net::web(sqlite_connection).await; diff --git a/src/sqlite/mod.rs b/src/sqlite/mod.rs index b336b53..2fe5076 100644 --- a/src/sqlite/mod.rs +++ b/src/sqlite/mod.rs @@ -30,11 +30,10 @@ pub async fn load_template(sqlite_handle: &SqlitePool) -> sqlx::Result sqlx::Result{ +pub async fn add_test_user(sqlite_handle: &SqlitePool)-> sqlx::Result{ sqlx::query("insert into users values('1923123','Elierik','erikeli',1,2,3);").execute(sqlite_handle).await } pub async fn sqlite_out(sqlite_handle: &SqlitePool, query:&str, index:usize) -> Result { sqlx::query(query).fetch_one(sqlite_handle).await.unwrap().try_get(index) -} - +} \ No newline at end of file