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)
| 40 | // connections in the cluster-mode worker, where eviction between sessions |
| 41 | // discards whatever settings ConfigureMainDB applied. |
| 42 | func 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 | } |
no test coverage detected