Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(derive): add#[postgres(allow_mismatch)]#1026

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

viniciusth
Copy link
Contributor

@viniciusthviniciusth commentedApr 30, 2023
edited
Loading

As discussed on#1023, this PR implements an override/attribute that allows mismatching Rust and Postgres enums.

Example

#[derive(ToSql,FromSql)]#[postgres(allow_mismatch)]enumMood{Sad,Happy,Meh,}

@viniciusth
Copy link
ContributorAuthor

Hey@sfackler could you please review this PR?

if #allow_mismatch{
returntrue;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd rather just not generate the match below at all if allow_mismatch is set.

viniciusth reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

true, fixed!

@sfacklersfackler merged commite7eb24a intorust-postgres:masterJul 23, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@sfacklersfacklerAwaiting requested review from sfackler

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@viniciusth@sfackler

[8]ページ先頭

©2009-2025 Movatter.jp