feat: add --log-queries flag for debugging client queries#327
Open
fuziontech wants to merge 2 commits intomainfrom
Open
feat: add --log-queries flag for debugging client queries#327fuziontech wants to merge 2 commits intomainfrom
fuziontech wants to merge 2 commits intomainfrom
Conversation
Adds a `--log-queries` flag (+ `DUCKGRES_LOG_QUERIES` env var + `log_queries` YAML config) that promotes query logging from Debug to Info level. This makes it easy to see exactly what SQL a client is sending without needing to change the global log level to debug (which is very noisy). Logs both simple protocol queries and extended protocol prepared statements, including transpiled output when it differs from the original. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--log-queriesflag /DUCKGRES_LOG_QUERIESenv var /log_queriesYAML configUseful for debugging why clients like Hex fail to pull schema — you can see the exact SQL they send without setting
log-level=debug(which is extremely noisy).Usage
Test plan
go buildcompiles cleanly--log-queriesand connect with psql, verify queries appear in stderr at Info level🤖 Generated with Claude Code