Skip to content

Conversation

@winebarrel
Copy link
Member

No description provided.

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 functionality to mark database tables as deprecated in the generated Go code. Users can now specify which tables should be marked as deprecated via a new command-line flag, and the generated structs and methods will include appropriate deprecation comments.

Key Changes:

  • Added --deprecated command-line flag to accept a list of table names to mark as deprecated
  • Updated code generation templates to conditionally add deprecation comments to structs and methods
  • Added Deprecated boolean field to the Struct type to track deprecation status

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
template/struct.tmpl Added conditional deprecation comment to generated struct type definitions
template/method.tmpl Added conditional deprecation comments to all generated methods (Create, Get, CreateContext, CreateOnConflictDoNothing, GetByPkContext) and removed trailing whitespace
main.go Added --deprecated flag definition and passed it to PgCreateStruct function
dgw.go Added Deprecated field to Struct type, updated PgTableToStruct and PgCreateStruct signatures to accept deprecated table list, and added logic to check if a table is in the deprecated list using slices.Contains
dgw_test.go Updated all PgTableToStruct and PgCreateStruct calls to include the new deprecated parameter, and added comprehensive test TestPgCreateStructWithDeprecated to verify deprecation comments are generated correctly
README.md Updated CLI documentation to include the new --deprecated flag

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

@winebarrel winebarrel merged commit 6c5bc6f into master Dec 5, 2025
6 checks passed
@winebarrel winebarrel deleted the add_deprecated_option branch December 5, 2025 04:38
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