Skip to content

Commit 3d51fbf

Browse files
authored
Merge pull request #19 from PostHog/fix/ducklake-use-default
Set DuckLake as default catalog after attaching
2 parents 731fe1a + 1e104ac commit 3d51fbf

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)