Skip to content

Emit enum array as a string under postgres/cockroach#175

Merged
alii merged 5 commits into
mainfrom
fix/107-enum-array-as-string
May 24, 2026
Merged

Emit enum array as a string under postgres/cockroach#175
alii merged 5 commits into
mainfrom
fix/107-enum-array-as-string

Conversation

@alii

@alii alii commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes #107

@alii alii requested a review from valtyr as a code owner May 18, 2026 10:21
@alii alii force-pushed the fix/107-enum-array-as-string branch from 35a561c to 51aafaa Compare May 24, 2026 13:40
@alii alii merged commit f41a74e into main May 24, 2026
4 checks passed
@alii alii deleted the fix/107-enum-array-as-string branch May 25, 2026 08:14
@isaac-sec

Copy link
Copy Markdown

This change is marked as a patch-level change, but it's a breaking change and my existing code now fails to compile.

The pg limitation with custom types (and especially enum arrays) is well known, so I've been using to_json and other JSON functions to convert to JSON in order to get an actual array of the enum type, but now this is erroneously typed by default as a string instead.

Additionally, because the column is typed as string the import of the enum type is now unused and I have to add an exclusion to "declared but never used" rule for the generated types or post process the file after generation, both of which I'd like to avoid.

Can we please revert this change or find a way to fix these issues? Thanks in advance!

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.

Type for an enum array is incorrectly generated

2 participants