Skip to content

Better postgres array of enum support#2179

Merged
jatcwang merged 1 commit intomainfrom
better_pg_enum_support
Jan 26, 2025
Merged

Better postgres array of enum support#2179
jatcwang merged 1 commit intomainfrom
better_pg_enum_support

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