Skip to content

Port SQLCDEBUG to a registry-style package modeled after Go's GODEBUG#4420

Merged
kyleconroy merged 1 commit intomainfrom
claude/go-debug-experiment-vars-uFoSq
Apr 30, 2026
Merged

Port SQLCDEBUG to a registry-style package modeled after Go's GODEBUG#4420
kyleconroy merged 1 commit intomainfrom
claude/go-debug-experiment-vars-uFoSq

Conversation

@kyleconroy
Copy link
Copy Markdown
Collaborator

Replace the monolithic opts.Debug snapshot with internal/sqlcdebug, which
exposes a master Settings table and per-call-site Setting handles via
sqlcdebug.New("name"). Each consumer reads its setting independently
through Setting.Value(), removing the need to thread a Debug struct
through cmd.Env, opts.Parser, and the analyzer constructors.

Migrated readers:

  • cmd: trace, processplugins, dumpcatalog, dumpvetenv, dumpexplain, databases
  • compiler: dumpast
  • postgresql/sqlite analyzers: databases
  • tracer: trace (now via tracer.Path())

The endtoend test fixture process_plugin_disabled now installs the
SQLCDEBUG override via sqlcdebug.Update for the duration of the subtest;
TestReplay subtests run sequentially, so no synchronization is needed.

Replace the monolithic opts.Debug snapshot with internal/sqlcdebug, which
exposes a master Settings table and per-call-site Setting handles via
sqlcdebug.New("name"). Each consumer reads its setting independently
through Setting.Value(), removing the need to thread a Debug struct
through cmd.Env, opts.Parser, and the analyzer constructors.

Migrated readers:
- cmd: trace, processplugins, dumpcatalog, dumpvetenv, dumpexplain, databases
- compiler: dumpast
- postgresql/sqlite analyzers: databases
- tracer: trace (now via tracer.Path())

The endtoend test fixture process_plugin_disabled now installs the
SQLCDEBUG override via sqlcdebug.Update for the duration of the subtest;
TestReplay subtests run sequentially, so no synchronization is needed.
@kyleconroy kyleconroy merged commit 5dfc713 into main Apr 30, 2026
13 checks passed
@kyleconroy kyleconroy deleted the claude/go-debug-experiment-vars-uFoSq branch April 30, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants