Delete & Post Game Endpoints. Various other changes
This commit is contained in:
parent
790a7dd8ee
commit
07e6df6b64
8 changed files with 493 additions and 107 deletions
src/db
|
@ -2,20 +2,4 @@ use std::error::Error;
|
|||
|
||||
use sqlx::{Postgres, postgres::PgConnectOptions, PgPool, Pool};
|
||||
|
||||
use crate::{PostgresConfig};
|
||||
|
||||
pub(crate) mod schemas;
|
||||
|
||||
pub(crate) async fn connect_postgres(config: PostgresConfig) -> Result<Pool<Postgres>, Box<dyn Error>> {
|
||||
|
||||
let connection_settings = PgConnectOptions::new()
|
||||
.host(&config.host)
|
||||
.port(config.port)
|
||||
.username(&config.user)
|
||||
.password(&config.password)
|
||||
.database(&config.db);
|
||||
|
||||
let pool = PgPool::connect_with(connection_settings).await?;
|
||||
|
||||
return Ok(pool);
|
||||
}
|
||||
pub(crate) mod schemas;
|
Reference in a new issue