@@ -89,6 +89,14 @@ trailing `_` — so `django/render.rs::django_field_name` applies Django's field
8989 pluralized table name to avoid colliding with the struct's own name
9090- ** No M2M/junction detection** : a junction table (composite-PK, 2+ FKs) is rendered as a plain
9191 has-many to the junction struct itself, not a dedicated M2M relation
92+ - ** Identifiers** : every struct, field and type name is an exported Go name (` exported_go_name ` :
93+ ` 1users ` → ` X1users ` ), ` Id ` becomes ` ID ` only where it ends a word (` UserID ` , but ` Identity ` ),
94+ and one taken set per struct covers the columns first and then every relation field, so a
95+ has-many or belongs-to never takes a column's name (` Posts2 ` , ` OrderRegions3 ` )
96+ - ** Tags** : ` index: ` /` uniqueIndex: ` names come from the naming builders, so they match what the
97+ SQL layer creates and GORM groups a composite index by them; ` char(N) ` and the PG network types
98+ carry an explicit ` type: ` ; a default GORM's tag syntax cannot hold (` " ` , ` ; ` , a function call)
99+ is omitted, and an integer enum's variant-name default becomes its value
92100- ** Package name** : there is no ` gorm ` config section. ` GormExporterWithConfig ` takes a resolved
93101 ` &str ` , which callers get from ` vespertide_config::go_package_name(export_dir) ` — the export
94102 directory's final path segment sanitized into a Go identifier, falling back to ` "models" ` . The
@@ -111,9 +119,9 @@ trailing `_` — so `django/render.rs::django_field_name` applies Django's field
111119 junctions reach one target) and run through ` django_field_name ` after the columns, so it never
112120 shadows a scalar field. Purely self-referential junctions are skipped rather than guessed at
113121- ** Composite (multi-column) FK** : Django has no native multi-column FK field, so
114- ` collect_composite_fks ` (from ` utils/common.rs ` , shared with SQLAlchemy, SQLModel and GORM) is used to emit a
115- ` # composite foreign key: (...) -> ref_table(...) ` comment instead of silently dropping the
116- relationship
122+ ` collect_composite_fks ` (from ` utils/common.rs ` , shared with SQLAlchemy, SQLModel and GORM)
123+ emits a ` # composite foreign key: (...) -> ref_table(...) ` comment instead of silently dropping
124+ the relationship
117125- ** ` build_default() ` ** : only emits a bare (unquoted) SQL default when it parses as a numeric
118126 literal — an unrecognized bare constant (e.g. a named SQL constant) is omitted rather than
119127 emitted as an undefined Python name
0 commit comments