(&self)
| 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) { |
no outgoing calls
no test coverage detected