MCPcopy Create free account
hub / github.com/PostHog/duckgres / effectiveSessionDefaultCommand

Function effectiveSessionDefaultCommand

controlplane/session_search_path.go:29–35  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

27// compat macros stay resolvable), so a DuckLake session only needs a command
28// when the client supplied its own search_path.
29func 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).

Calls 1