Skip to content

Fix DuckLake query startup with an empty catalog - #92

Merged
viggy28 merged 1 commit into
mainfrom
fix/ducklake-empty-catalog-query
Sep 4, 2026
Merged

Fix DuckLake query startup with an empty catalog#92
viggy28 merged 1 commit into
mainfrom
fix/ducklake-empty-catalog-query

Conversation

@viggy28

@viggy28 viggy28 commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Closes #89.

What changed

  • Detect whether the attached DuckLake catalog contains the PostgreSQL public schema before setting the query search path.
  • Use streambed.main while the catalog is empty.
  • Prefer streambed.public once the writer creates it.
  • Keep the existing fresh, read-only attachment per client query, so the new schema becomes visible without restarting Streambed.
  • Add regression coverage for both DuckDB-backed and SQLite-backed DuckLake catalogs.

Why

DuckDB rejects a search path containing a nonexistent catalog schema. A fresh DuckLake catalog has main, while Streambed creates public only after the first PostgreSQL relation is flushed. The previous unconditional search path made sync --target-format=ducklake --query-addr=... fail during startup.

Validation

go test ./internal/server -count=1
go test ./internal/... ./config/... -count=1

Both pass. The regression test starts the query server before public exists, flushes the first table through the writer, then verifies an unqualified query resolves it without recreating the server.

@viggy28
viggy28 merged commit 92fbcef into main Sep 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow DuckLake query server to start with an empty catalog

1 participant