Skip to content

Commit 1e104ac

Browse files
EDsCODEclaude
andcommitted
Set DuckLake as default catalog after attaching
After attaching DuckLake, run USE ducklake to set it as the default catalog. This follows the DuckDB documentation recommendation and ensures all queries automatically use DuckLake without needing to prefix table names with ducklake. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 84db100 commit 1e104ac

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

server/server.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,13 @@ func (s *Server) attachDuckLake(db *sql.DB) error {
327327
return fmt.Errorf("failed to attach DuckLake: %w", err)
328328
}
329329

330-
log.Printf("Attached DuckLake catalog successfully")
330+
// Set DuckLake as the default catalog so all queries use it
331+
// See: https://duckdb.org/docs/stable/core_extensions/ducklake#usage
332+
if _, err := db.Exec("USE ducklake"); err != nil {
333+
return fmt.Errorf("failed to set DuckLake as default catalog: %w", err)
334+
}
335+
336+
log.Printf("Attached DuckLake catalog successfully and set as default")
331337
return nil
332338
}
333339

0 commit comments

Comments
 (0)