Delete & Post Game Endpoints. Various other changes

This commit is contained in:
Neshura 2023-08-30 04:16:43 +02:00
parent 790a7dd8ee
commit 07e6df6b64
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
8 changed files with 493 additions and 107 deletions
src/db

View file

@ -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;