Skip to content

feat: honor omit_unused_structs (#74) - #104

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

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

Conversation

@aimestereo

@aimestereo aimestereo commented Sep 16, 2026 •

Copy link
Copy Markdown

AI generated change for internal use, that I share as-is.

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 (Go codegen order)
  • Python keep-set: bare name + models.Name (no Go NullXxx wrappers)
  • Endtoend fixture mirroring sqlc omit_unused_structs testdata
  • Bump CI and goldens to sqlc 1.30.0 so version headers match

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. Bump CI/goldens to sqlc 1.30.0.
@aimestereo

Copy link
Copy Markdown
Author

Closing in favor of a slimmer PR. This branch mixed the feature with a local sqlc 1.28 → 1.30 golden/CI bump that Fenix needs but upstream does not.

Replacement: new PR from feat/omit-unused-structs-upstream (kernel + new fixture only).

@aimestereo aimestereo closed this Sep 16, 2026
@aimestereo
aimestereo deleted the feat/omit-unused-structs branch September 16, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant