feat: implemente delete account for postgres via sqlx

This commit is contained in:
realaravinth 2022-05-11 12:31:04 +05:30
parent 4bdbb52d8f
commit 5dc818a1c1
No known key found for this signature in database
GPG key ID: AD9F0F08E855ED88

View file

@ -129,6 +129,15 @@ impl MCDatabase for Database {
res.map_err(map_register_err)?;
Ok(())
}
/// delete a user
async fn delete_user(&self, username: &str) -> DBResult<()> {
sqlx::query!("DELETE FROM mcaptcha_users WHERE name = ($1)", username)
.execute(&self.pool)
.await
.map_err(map_register_err)?;
Ok(())
}
}
fn now_unix_time_stamp() -> i64 {