Verify that the required InsForge tables exist and are accessible.
()
| 166 | @cli.command("init") |
| 167 | @handle_errors |
| 168 | def cmd_init() -> None: |
| 169 | """Verify that the required InsForge tables exist and are accessible.""" |
| 170 | with InsForgeClient() as client: |
| 171 | missing = [t for t in REQUIRED_TABLES if not client.table_exists(t)] |
| 172 | |
| 173 | if not missing: |
| 174 | console.print(Panel( |
| 175 | "[green]Database ready.[/] Tables [bold]experiments[/] and [bold]runs[/] are accessible.", |
| 176 | )) |
| 177 | return |
| 178 | |
| 179 | missing_list = ", ".join(f"[bold]{t}[/]" for t in missing) |
| 180 | err_console.print(Panel( |
| 181 | f"[yellow]Missing tables:[/] {missing_list}\n\n" |
| 182 | "InsForge table creation requires admin access. Ask your project admin to run " |
| 183 | "the following migration via the InsForge dashboard or admin API:\n\n" |
| 184 | f"[dim]{ADMIN_SETUP_SQL}[/]", |
| 185 | title="Setup required", |
| 186 | border_style="yellow", |
| 187 | )) |
| 188 | raise SystemExit(1) |
| 189 | |
| 190 | |
| 191 | # ── tracker log ─────────────────────────────────────────────────────────── |
nothing calls this directly
no test coverage detected