Skip to content

feat: honor omit_unused_structs (#74) - #105

Open
aimestereo wants to merge 1 commit into
sqlc-dev:mainfrom
ablt-ai:feat/omit-unused-structs-upstream
Open

aimestereo wants to merge 1 commit into
sqlc-dev:mainfrom
ablt-ai:feat/omit-unused-structs-upstream

Conversation

@aimestereo

@aimestereo aimestereo commented Sep 16, 2026

Copy link
Copy Markdown

Hello, I'm sharing what I have AI generated for internal use.

Fixes #74

The Python plugin ignored omit_unused_structs because Config had no field for it. This ports Go's filterUnusedStructs so unused table and enum types are omitted from models.py.

  • Add OmitUnusedStructs to plugin config
  • Filter enums/models after queries are built (same order as Go codegen)
  • Python keep-set: bare name + models.Name (no Go NullXxx wrappers)
  • Endtoend fixture mirroring sqlc's omit_unused_structs testdata
  • README option note

Query Params/Row structs stay in query.py (Emit: true).

Made with Cursor

Port Go's filterUnusedStructs so unused table and enum models
are omitted from models.py when the option is set.

Co-authored-by: Cursor <[email protected]>
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.

Support omit_unused_structs configuration parameter

1 participant