-
Notifications
You must be signed in to change notification settings - Fork 29
chore: log sql statement when apply/plan when —debug #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds SQL statement logging capability for debug mode by introducing a logging wrapper around database execution calls. The changes enable developers to trace SQL execution when debug mode is enabled.
Key Changes:
- Added
IsDebug()helper function to the logger package for checking debug mode status - Created new SQL logging utility functions that wrap
ExecContextcalls with debug logging - Updated all
ExecContextcalls in postgres and apply commands to use the new logging wrappers
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
internal/logger/logger.go |
Added IsDebug() function to expose debug mode status |
cmd/util/sql_logger.go |
New utility file with SQL execution logging wrappers for *sql.DB and *sql.Conn |
internal/postgres/external.go |
Replaced direct ExecContext calls with logging wrapper in schema management operations |
internal/postgres/embedded.go |
Replaced direct ExecContext calls with logging wrapper in schema management operations |
cmd/apply/apply.go |
Replaced direct ExecContext calls with logging wrapper for lock timeout, search_path, and SQL execution operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix #150