File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 3939 CLICKHOUSE_SECURE : " false"
4040 CLICKHOUSE_VERIFY : " false"
4141 CHDB_ENABLED : " true"
42- CHDB_DATA_PATH : " :memory:"
4342 run : |
4443 uv run pytest tests
4544
Original file line number Diff line number Diff line change @@ -227,8 +227,8 @@ The following environment variables are used to configure the ClickHouse and chD
227227 * Default: ` "false" `
228228 * Set to ` "true" ` to enable chDB tools
229229* ` CHDB_DATA_PATH ` : The path to the chDB data directory
230- * Required when ` CHDB_ENABLED=true `
231- * Use ` :memory: ` for in-memory database (recommended for testing)
230+ * Default: ` ":memory:" ` (in-memory database)
231+ * Use ` :memory: ` for in-memory database
232232 * Use a file path for persistent storage (e.g., ` /path/to/chdb/data ` )
233233
234234#### Example Configurations
@@ -274,7 +274,7 @@ For chDB only (in-memory):
274274# chDB configuration
275275CHDB_ENABLED=true
276276CLICKHOUSE_ENABLED=false
277- CHDB_DATA_PATH= :memory:
277+ # CHDB_DATA_PATH defaults to :memory:
278278```
279279
280280For chDB with persistent storage:
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ def enabled(self) -> bool:
197197 @property
198198 def data_path (self ) -> str :
199199 """Get the chDB data path."""
200- return os .environ [ "CHDB_DATA_PATH" ]
200+ return os .getenv ( "CHDB_DATA_PATH" , ":memory:" )
201201
202202 def get_client_config (self ) -> dict :
203203 """Get the configuration dictionary for chDB client.
@@ -215,8 +215,7 @@ def _validate_required_vars(self) -> None:
215215 Raises:
216216 ValueError: If any required environment variable is missing.
217217 """
218- if self .enabled and "CHDB_DATA_PATH" not in os .environ :
219- raise ValueError ("Missing required environment variable: CHDB_DATA_PATH" )
218+ pass
220219
221220
222221# Global instance placeholders for the singleton pattern
Original file line number Diff line number Diff line change @@ -328,7 +328,8 @@ def _init_chdb_client():
328328
329329if get_chdb_config ().enabled :
330330 _chdb_client = _init_chdb_client ()
331- atexit .register (lambda : _chdb_client .close () if _chdb_client is not None else None )
331+ if _chdb_client :
332+ atexit .register (lambda : _chdb_client .close ())
332333
333334 mcp .add_tool (run_chdb_select_query )
334335 chdb_prompt = Prompt .from_function (
You can’t perform that action at this time.
0 commit comments