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

Rewrite Postgres array type handling #1385

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

jplatte
Copy link
Contributor

@jplatte jplatte commented Aug 17, 2021

… to reduce boilerplate and allow custom types.

Fixes Relates to #298.

Future possibilities: Let the Type derive macro generate an impl of the new PgHasArrayType trait.

… to reduce boilerplate and allow custom types.
@jplatte
Copy link
Contributor Author

jplatte commented Nov 13, 2021

I am pretty certain this is not a breaking change. It only introduces a new trait and
re-routes existing Type implementations through that trait (not changing whether those types implement Type). Outside crates were never able to implement Type for [Foo] / Type for &'_ [Foo] / Type for Vec<Foo> before, so the new blanket impl doesn't break that either.

@abonander abonander merged commit 12d9f54 into launchbadge:master Nov 23, 2021
@jplatte jplatte deleted the postgres-array branch November 23, 2021 06:42
@meh
Copy link
Contributor

meh commented Dec 5, 2021

Is there a way to create a PgTypeInfo::with_name to implement PgHasArrayType?

@jplatte
Copy link
Contributor Author

jplatte commented Dec 5, 2021

Yes, the idea is that you would implement PgHasArrayType for custom types as PgTypeInfo::with_name("_custom_type_name") (when the non-array type is called custom_type_name without the leading underscore).

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.

3 participants