streamline code

This commit is contained in:
Erik Foris 2021-10-04 14:05:40 +00:00
parent 55557b604b
commit ce99469b3d
2 changed files with 3 additions and 4 deletions

View File

@ -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;

View File

@ -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)
} }