|
@ -14,9 +14,6 @@ use crate::entity::item::*; |
|
|
use super::models::*;
|
|
|
use super::models::*;
|
|
|
|
|
|
|
|
|
use sqlx::postgres::PgPoolOptions;
|
|
|
use sqlx::postgres::PgPoolOptions;
|
|
|
use sqlx::Row;
|
|
|
|
|
|
use sqlx::Execute;
|
|
|
|
|
|
use postgres::{Client, NoTls};
|
|
|
|
|
|
|
|
|
|
|
|
mod embedded {
|
|
|
mod embedded {
|
|
|
use refinery::embed_migrations;
|
|
|
use refinery::embed_migrations;
|
|
@ -123,14 +120,14 @@ impl EntityGateway for PostgresGateway { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
async fn save_user(&mut self, user: &UserAccountEntity) -> Result<(), GatewayError> {
|
|
|
async fn save_user(&mut self, user: &UserAccountEntity) -> Result<(), GatewayError> {
|
|
|
sqlx::query("UPDATE user_accounts set name=$1, password=$2, banned=$3, muted=$4, flags=$5 where id=$6")
|
|
|
|
|
|
|
|
|
sqlx::query("UPDATE user_accounts set username=$1, password=$2, banned=$3, muted=$4, flags=$5 where id=$6")
|
|
|
.bind(&user.username)
|
|
|
.bind(&user.username)
|
|
|
.bind(&user.password)
|
|
|
.bind(&user.password)
|
|
|
.bind(&user.banned_until)
|
|
|
.bind(&user.banned_until)
|
|
|
.bind(&user.muted_until)
|
|
|
.bind(&user.muted_until)
|
|
|
.bind(&user.flags)
|
|
|
.bind(&user.flags)
|
|
|
.bind(&user.id.0)
|
|
|
.bind(&user.id.0)
|
|
|
.fetch_one(&self.pool).await?;
|
|
|
|
|
|
|
|
|
.execute(&self.pool).await?;
|
|
|
Ok(())
|
|
|
Ok(())
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|