Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better postgres array of enum support #2179

Merged
merged 1 commit into from
Jan 26, 2025
Merged

Conversation

jatcwang
Copy link
Collaborator

Add a helper doobie.postgres.implicits.arrayOfEnum with better typechecking support.

For an array column, postgres prefixes _ in front of the type name, therefore the expected vendor type name is e.g. _myenum

Also added some tests / examples to test array of enum where the enum is defined in another schema. (e.g. Reported vendor type name is "other_schema"."_other_enum" for the column type other_schema.other_enum[])

Fixes #2107 #2127

Add a helper `doobie.postgres.implicits.arrayOfEnum` with better
typechecking support.

For an array column, postgres prefixes `_` in front of the type name,
therefore the expected vendor type name is e.g. `_myenum`

Also added some tests / examples to test array of enum where the enum is
defined in another schema. (e.g. Reported vendor type name is `"other_schema"."_other_enum"` for the
column type `other_schema.other_enum[]`)
@jatcwang jatcwang merged commit e0a3105 into main Jan 26, 2025
11 checks passed
@jatcwang jatcwang deleted the better_pg_enum_support branch February 1, 2025 20:03
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.

Document how to work with Array of custom types
1 participant