From 018b5af67cc62471d405a31ed0a95b65b91d6e3f Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 16 Jul 2021 06:54:12 +0000 Subject: [PATCH] add redout capabilities --- src/sqlite/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/sqlite/mod.rs b/src/sqlite/mod.rs index 06e2738..9c9d493 100644 --- a/src/sqlite/mod.rs +++ b/src/sqlite/mod.rs @@ -26,4 +26,13 @@ pub async fn load_template(sqlite_handle: &mut SqliteConnection) -> sqlx::Result include_str!("external_servers_privacy_preferences.sql"), include_str!("external_servers_preferences.sql"), )).execute(sqlite_handle).await -} \ No newline at end of file +} + +pub async fn add_test_user(sqlite_handle: &mut SqliteConnection)-> 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: &mut SqliteConnection, query:&str, index:usize) -> Result { + sqlx::query(query).fetch_one(sqlite_handle).await.unwrap().try_get(index) +} +