add redout capabilities

This commit is contained in:
Erik Foris 2021-07-16 06:54:12 +00:00
parent 95d15f7a9d
commit 018b5af67c

View File

@ -27,3 +27,12 @@ pub async fn load_template(sqlite_handle: &mut SqliteConnection) -> sqlx::Result
include_str!("external_servers_preferences.sql"), include_str!("external_servers_preferences.sql"),
)).execute(sqlite_handle).await )).execute(sqlite_handle).await
} }
pub async fn add_test_user(sqlite_handle: &mut SqliteConnection)-> sqlx::Result<SqliteQueryResult>{
sqlx::query("insert into users values('1923123','Elierik','erikeli',1,2,3);").execute(sqlite_handle).await
}
pub async fn sqlite_out(sqlite_handle: &mut SqliteConnection, query:&str, index:usize) -> Result<String, sqlx::Error> {
sqlx::query(query).fetch_one(sqlite_handle).await.unwrap().try_get(index)
}