File tree Expand file tree Collapse file tree 5 files changed +164
-148
lines changed Expand file tree Collapse file tree 5 files changed +164
-148
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 @@ -224,8 +224,8 @@ The following environment variables are used to configure the ClickHouse and chD
224224 * Default: ` "false" `
225225 * Set to ` "true" ` to enable chDB tools
226226* ` CHDB_DATA_PATH ` : The path to the chDB data directory
227- * Required when ` CHDB_ENABLED=true `
228- * Use ` :memory: ` for in-memory database (recommended for testing)
227+ * Default: ` ":memory:" ` (in-memory database)
228+ * Use ` :memory: ` for in-memory database
229229 * Use a file path for persistent storage (e.g., ` /path/to/chdb/data ` )
230230
231231#### Example Configurations
@@ -271,7 +271,7 @@ For chDB only (in-memory):
271271# chDB configuration
272272CHDB_ENABLED=true
273273CLICKHOUSE_ENABLED=false
274- CHDB_DATA_PATH= :memory:
274+ # CHDB_DATA_PATH defaults to :memory:
275275```
276276
277277For chDB with persistent storage:
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ def enabled(self) -> bool:
181181 @property
182182 def data_path (self ) -> str :
183183 """Get the chDB data path."""
184- return os .environ [ "CHDB_DATA_PATH" ]
184+ return os .getenv ( "CHDB_DATA_PATH" , ":memory:" )
185185
186186 def get_client_config (self ) -> dict :
187187 """Get the configuration dictionary for chDB client.
@@ -199,8 +199,7 @@ def _validate_required_vars(self) -> None:
199199 Raises:
200200 ValueError: If any required environment variable is missing.
201201 """
202- if self .enabled and "CHDB_DATA_PATH" not in os .environ :
203- raise ValueError ("Missing required environment variable: CHDB_DATA_PATH" )
202+ pass
204203
205204
206205# Global instance placeholders for the singleton pattern
Original file line number Diff line number Diff line change @@ -325,7 +325,8 @@ def _init_chdb_client():
325325
326326if get_chdb_config ().enabled :
327327 _chdb_client = _init_chdb_client ()
328- atexit .register (lambda : _chdb_client .close () if _chdb_client is not None else None )
328+ if _chdb_client :
329+ atexit .register (lambda : _chdb_client .close ())
329330
330331 mcp .add_tool (run_chdb_select_query )
331332 chdb_prompt = Prompt .from_function (
You can’t perform that action at this time.
0 commit comments