MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / connection_with_search_path_postgres

Function connection_with_search_path_postgres

tests/connection_tests.rs:146–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144#[sea_orm_macros::test]
145#[cfg(feature = "sqlx-postgres")]
146pub async fn connection_with_search_path_postgres() {
147 let ctx = TestContext::new("connection_with_search_path").await;
148
149 let base_url = std::env::var("DATABASE_URL").unwrap();
150 let mut opt = sea_orm::ConnectOptions::new(format!("{base_url}/connection_with_search_path"));
151 opt
152 // The connection pool has a single connection only
153 .max_connections(1)
154 // A controlled connection acquire timeout
155 .acquire_timeout(std::time::Duration::from_secs(2))
156 .set_schema_search_path("schema-with-special-characters");
157
158 let db = sea_orm::Database::connect(opt).await;
159 assert!(db.is_ok());
160
161 ctx.delete().await;
162}

Callers

nothing calls this directly

Calls 6

unwrapMethod · 0.80
acquire_timeoutMethod · 0.80
max_connectionsMethod · 0.80
newFunction · 0.50
deleteMethod · 0.45

Tested by

no test coverage detected