|
10 | 10 | from pathlib import Path
|
11 | 11 | from typing import Any
|
12 | 12 |
|
| 13 | +# Error messages |
| 14 | +_DATABASE_PATH_ERROR_MSG = ( |
| 15 | + "Could not determine default database path for mimic-iv-demo.\n" |
| 16 | + "Please run 'm3 init mimic-iv-demo' first." |
| 17 | +) |
| 18 | + |
13 | 19 |
|
14 | 20 | class MCPConfigGenerator:
|
15 | 21 | """Generator for MCP server configurations."""
|
@@ -165,16 +171,19 @@ def interactive_config(self) -> dict[str, Any]:
|
165 | 171 |
|
166 | 172 | if backend == "sqlite":
|
167 | 173 | print("\n📁 SQLite Configuration:")
|
| 174 | + from m3.config import get_default_database_path |
| 175 | + |
| 176 | + default_db_path = get_default_database_path("mimic-iv-demo") |
| 177 | + if default_db_path is None: |
| 178 | + raise ValueError(_DATABASE_PATH_ERROR_MSG) |
| 179 | + print(f"Default database path: {default_db_path}") |
| 180 | + |
168 | 181 | db_path = (
|
169 | 182 | input(
|
170 | 183 | "SQLite database path (optional, press Enter to use default): "
|
171 | 184 | ).strip()
|
172 | 185 | or None
|
173 | 186 | )
|
174 |
| - if db_path: |
175 |
| - print(f"✅ Will use database: {db_path}") |
176 |
| - else: |
177 |
| - print("✅ Will use default database path") |
178 | 187 |
|
179 | 188 | elif backend == "bigquery":
|
180 | 189 | print("\n☁️ BigQuery Configuration:")
|
@@ -269,6 +278,15 @@ def print_config_info(config: dict[str, Any]):
|
269 | 278 |
|
270 | 279 | if "M3_DB_PATH" in server_config["env"]:
|
271 | 280 | print(f"💾 Database path: {server_config['env']['M3_DB_PATH']}")
|
| 281 | + elif server_config["env"].get("M3_BACKEND") == "sqlite": |
| 282 | + # Show the default path when using SQLite backend |
| 283 | + from m3.config import get_default_database_path |
| 284 | + |
| 285 | + default_path = get_default_database_path("mimic-iv-demo") |
| 286 | + if default_path is None: |
| 287 | + raise ValueError(_DATABASE_PATH_ERROR_MSG) |
| 288 | + print(f"💾 Database path: {default_path}") |
| 289 | + |
272 | 290 | if "M3_PROJECT_ID" in server_config["env"]:
|
273 | 291 | print(f"☁️ Project ID: {server_config['env']['M3_PROJECT_ID']}")
|
274 | 292 |
|
|
0 commit comments