Skip to content

Conversation

@tianzhou
Copy link
Contributor

@tianzhou tianzhou commented Nov 7, 2025

Fix #150

Copilot AI review requested due to automatic review settings November 7, 2025 17:16
Copy link
Contributor

Copilot AI left a 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 ExecContext calls with debug logging
  • Updated all ExecContext calls 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.

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

@tianzhou tianzhou merged commit 95eae2b into main Nov 7, 2025
8 checks passed
@tianzhou tianzhou deleted the debug branch November 23, 2025 14:51
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.

Display SQL commands in debug mode

1 participant