Skip to content

Conversation

@tianzhou
Copy link
Contributor

Fix #262

Add CLI option to suppress object comment headers (-- Name: ...; Type: ...) in dump output while retaining the dump header. This enables users to get pure DDL output without post-processing.

Add CLI option to suppress object comment headers (-- Name: ...; Type: ...)
in dump output while retaining the dump header. This enables users to get
pure DDL output without post-processing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 28, 2026 15:15
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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 a --no-comments flag to the dump command that suppresses object comment headers (e.g., -- Name: users; Type: TABLE; Schema: -; Owner: -) in dump output while retaining the dump header. This addresses issue #262 by providing users with pure DDL output without requiring post-processing.

Changes:

  • Added --no-comments CLI flag to the dump command
  • Modified DumpFormatter to conditionally suppress object comment headers based on the flag
  • Updated all tests to accommodate the new parameter in DumpFormatter constructor

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

File Description
internal/dump/formatter.go Added noComments field to DumpFormatter and conditional logic to suppress object comment headers in both single-file and multi-file formatting
cmd/dump/dump.go Added --no-comments flag definition and wired it through DumpConfig to the formatter
cmd/dump/multifile_test.go Updated NewDumpFormatter calls with the new noComments parameter (false)
cmd/dump/dump_test.go Added flag definition test and comprehensive behavior tests for single-file mode with and without the flag

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tianzhou tianzhou merged commit dd56db9 into main Jan 28, 2026
1 check passed
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.

Request: CLI option to exclude pgschema comments from dump

1 participant