MCPcopy Create free account
hub / github.com/erans/pgsqlite / create_connection

Method create_connection

src/session/pool.rs:167–184  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

165 }
166
167 fn create_connection(&self) -> Result<Connection> {
168 let conn = if self.path == ":memory:" {
169 Connection::open_in_memory()?
170 } else {
171 Connection::open(&self.path)?
172 };
173
174 // Set pragmas for better performance
175 conn.execute_batch(
176 "PRAGMA journal_mode=WAL;
177 PRAGMA synchronous=NORMAL;
178 PRAGMA cache_size=-64000;
179 PRAGMA temp_store=MEMORY;
180 PRAGMA mmap_size=268435456;"
181 )?;
182
183 Ok(conn)
184 }
185
186 #[allow(dead_code)]
187 async fn background_health_check(&self) {

Callers 2

new_with_configMethod · 0.45
acquireMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected