Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

Additional changes to #2307 to get the tests to pass

rollulus and others added 3 commits September 9, 2022 12:02
Column names are less restricted than Go struct field names, which
should be proper Go identifiers. Hence, column names cannot be
translated directly into field names. This commit tries to address
this.

Characters in column names that do not qualify as a Go identifier
are stripped. The title casing as applied to underscores is applied
to stripped characters.
@kyleconroy kyleconroy merged commit 308583e into main Jun 8, 2023
@kyleconroy kyleconroy deleted the fix/field-names branch June 8, 2023 00:27
alfonsodev pushed a commit to ExponentiaTeam/sqlc that referenced this pull request Oct 13, 2025
…lc-dev#2314)

* fix: Let column names not result in invalid Go field names

Column names are less restricted than Go struct field names, which
should be proper Go identifiers. Hence, column names cannot be
translated directly into field names. This commit tries to address
this.

Characters in column names that do not qualify as a Go identifier
are stripped. The title casing as applied to underscores is applied
to stripped characters.

* test: Add updated tests

---------

Co-authored-by: Rollulus <rollulus@xs4all.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants