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

Add support for type mapping #255

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

duarten
Copy link

@duarten duarten commented Jul 17, 2024

Similar to Kanel's customTypeMap.

One use case for this is allowing one to treat PG extension types as some other types that they behave as (e.g., map public.ulid to String).

This allows treating a type as some custom type, requiring the user to implement ToSql, FromSql, and a XxxBorrowed variant on it. Additionally, we treat mapping to String as a special case.

This is a POC for #246. Happy to improve the PR and add tests if the direction sounds good.

Similar to Kanel's customTypeMap.

One use case for this is allowing one to treat PG extension types as
some other types that they behave as (e.g., map public.ulid to String).

Fixes cornucopia-rs#246
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.

1 participant