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

Function ApplyProfilingSettings

server/profiling.go:42–48  ·  view source on GitHub ↗

ApplyProfilingSettings runs ProfilingSetupSQL against the given connection, writing profiles to ProfilingOutputPath. Use this for connections that bypass ConfigureMainDB — primarily fresh per-session connections in the cluster-mode worker, where eviction between sessions discards whatever settings C

(ctx context.Context, conn *sql.Conn)

Source from the content-addressed store, hash-verified

40// connections in the cluster-mode worker, where eviction between sessions
41// discards whatever settings ConfigureMainDB applied.
42func ApplyProfilingSettings(ctx context.Context, conn *sql.Conn) {
43 for _, stmt := range ProfilingSetupSQL(ProfilingOutputPath) {
44 if _, err := conn.ExecContext(ctx, stmt); err != nil {
45 slog.Warn("Failed to apply DuckDB profiling setting on session conn.", "stmt", stmt, "error", err)
46 }
47 }
48}

Callers 1

CreateSessionMethod · 0.92

Calls 2

ProfilingSetupSQLFunction · 0.85
ExecContextMethod · 0.65

Tested by

no test coverage detected