tests are passing better than ever before, its looking decent actually nowc

This commit is contained in:
filipriec
2025-06-21 16:18:32 +02:00
parent 714a5f2f1c
commit 298f56a53c
4 changed files with 42 additions and 16 deletions

View File

@@ -41,12 +41,18 @@ pub async fn setup_isolated_db() -> PgPool {
.await
.unwrap_or_else(|_| panic!("Failed to create schema: {}", schema_name));
root_conn
.execute("CREATE SCHEMA IF NOT EXISTS \"default\"")
.await
.unwrap();
let pool = PgPoolOptions::new()
.max_connections(5)
.after_connect(move |conn, _meta| {
let schema_name = schema_name.clone();
Box::pin(async move {
conn.execute(format!("SET search_path TO \"{}\"", schema_name).as_str())
conn.execute(format!("SET search_path TO \"{}\", \"default\", \"public\"", schema_name).as_str())
.await?;
Ok(())
})