Commit 15fe529
feat(attach): name discovered catalog as the DB alias
On the bare connection-string form, DuckDB derives the database alias from
the path basename, so `vgi:uvx vgi-easter` surfaced as the ugly
`uvx vgi-easter` rather than the catalog name. When the alias was
path-derived (CLI default-DB open, or ATTACH with no AS clause), rename
the AttachedDatabase to the discovered catalog name via SetName().
Registration reads GetName() after attach (DatabaseManager::FinalizeAttach)
and derives the default-database pointer from it, so the rename is honored
consistently — current_database() and unqualified lookups resolve under the
catalog name. A user-chosen `AS alias` (name differs from the path
basename) is left untouched.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent e19e189 commit 15fe529
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
1333 | 1334 | | |
1334 | 1335 | | |
1335 | 1336 | | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
1336 | 1351 | | |
1337 | 1352 | | |
1338 | 1353 | | |
| |||
0 commit comments