streamline code
This commit is contained in:
parent
55557b604b
commit
ce99469b3d
@ -40,7 +40,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
sqlite::load_template(&sqlite_connection).await?;
|
sqlite::load_template(&sqlite_connection).await?;
|
||||||
|
|
||||||
sqlite::add_test_user(&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;
|
net::web(sqlite_connection).await;
|
||||||
|
@ -37,4 +37,3 @@ pub async fn add_test_user(sqlite_handle: & SqlitePool)-> sqlx::Result<SqliteQue
|
|||||||
pub async fn sqlite_out(sqlite_handle: &SqlitePool, query:&str, index:usize) -> Result<String, sqlx::Error> {
|
pub async fn sqlite_out(sqlite_handle: &SqlitePool, query:&str, index:usize) -> Result<String, sqlx::Error> {
|
||||||
sqlx::query(query).fetch_one(sqlite_handle).await.unwrap().try_get(index)
|
sqlx::query(query).fetch_one(sqlite_handle).await.unwrap().try_get(index)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user