mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2024-11-27 03:48:52 +03:00
feat: implemente delete account for postgres via sqlx
This commit is contained in:
parent
4bdbb52d8f
commit
5dc818a1c1
1 changed files with 9 additions and 0 deletions
|
@ -129,6 +129,15 @@ impl MCDatabase for Database {
|
||||||
res.map_err(map_register_err)?;
|
res.map_err(map_register_err)?;
|
||||||
Ok(())
|
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 {
|
fn now_unix_time_stamp() -> i64 {
|
||||||
|
|
Loading…
Reference in a new issue