Get or create DuckDB connection
(self)
| 36 | raise ValueError(f"Data directory does not exist: {datadir}") |
| 37 | |
| 38 | def connect(self): |
| 39 | """Get or create DuckDB connection""" |
| 40 | if self.conn is None: |
| 41 | self.conn = duckdb.connect(':memory:') |
| 42 | # Configure thread count if specified |
| 43 | if self.duckdb_threads is not None: |
| 44 | self.conn.execute(f"SET threads TO {self.duckdb_threads}") |
| 45 | return self.conn |
| 46 | |
| 47 | def close(self): |
| 48 | """Close DuckDB connection""" |
no test coverage detected