effectiveSessionDefaultCommand returns the connect-time command for a non-passthrough session, given the resolved real catalog the session defaults to (effectiveCatalog, "ducklake"). For DuckLake the catalog switch is owned by InitSessionDatabaseMetadata's defer (which also restores memory.main on
(clientSearchPath, effectiveCatalog string)
| 27 | // compat macros stay resolvable), so a DuckLake session only needs a command |
| 28 | // when the client supplied its own search_path. |
| 29 | func effectiveSessionDefaultCommand(clientSearchPath, effectiveCatalog string) (string, sessionSearchPathSource) { |
| 30 | if clientSearchPath != "" { |
| 31 | searchPath := fmt.Sprintf("SET search_path = '%s'", ensureMemoryMainInSearchPath(clientSearchPath)) |
| 32 | return searchPath, sessionSearchPathSourceClient |
| 33 | } |
| 34 | return "", "" |
| 35 | } |
| 36 | |
| 37 | // passthroughSessionDefaultCatalogCommand returns the connect-time command that |
| 38 | // points a passthrough session at the catalog it selected (effectiveCatalog). |