mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
feat: implement update username for sqlx postgres
This commit is contained in:
@@ -237,6 +237,20 @@ impl MCDatabase for Database {
|
|||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// update username
|
||||||
|
async fn update_username(&self, current: &str, new: &str) -> DBResult<()> {
|
||||||
|
sqlx::query!(
|
||||||
|
"UPDATE mcaptcha_users set name = $1
|
||||||
|
WHERE name = $2",
|
||||||
|
new,
|
||||||
|
current,
|
||||||
|
)
|
||||||
|
.execute(&self.pool)
|
||||||
|
.await
|
||||||
|
.map_err(map_register_err)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn now_unix_time_stamp() -> i64 {
|
fn now_unix_time_stamp() -> i64 {
|
||||||
|
|||||||
Reference in New Issue
Block a user