Skip to content

Conversation

@VarusHsu
Copy link

@VarusHsu VarusHsu commented Sep 30, 2025

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Consider adding an option to generate models only.

User Case Description

@propel-code-bot
Copy link

Add WithoutQuery Mode to Support Model-Only Code Generation

This pull request introduces a new WithoutQuery mode to the code generation process, enabling users to generate only model code without the associated query code. The changes consist of updating the GenerateMode enum with a WithoutQuery value in config.go, and adding corresponding logic in generator.go to conditionally skip query file generation when this mode is active. The implementation is intentionally non-breaking and adds to existing features without modifying current behaviors when the new mode is not set.

Key Changes

• Added WithoutQuery value to the GenerateMode enum in config.go
• Documented WithoutQuery with associated comments for clarity
• Updated generator.go's generateQueryFile method to check for WithoutQuery mode and return early if set, effectively skipping generation of query-related code files

Affected Areas

config.go (enum definition and comments)
generator.go (generateQueryFile logic)

This summary was automatically generated by @propel-code-bot

Copy link

@propel-code-bot propel-code-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ship it! 🚢


Why was this auto-approved?
AI analysis completed with no actionable comments or suggestions.

@qqxhb
Copy link
Member

qqxhb commented Oct 15, 2025

Without calling apply, query code will not be generated.
g.GenerateModel("users") //no query
g.ApplyBasic(g.GenerateModel("users"))

@qqxhb qqxhb closed this Oct 15, 2025
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