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

Filter rows with IS IN enum values expression #1183

Merged
merged 2 commits into from
Nov 15, 2022

Conversation

billy1624
Copy link
Member

PR Info

With SeaQL/sea-query#476, we'll have a fluent API, e.g.

assert_eq!(
    model,
    Entity::find()
        .filter(Column::Tea.is_in([Tea::EverydayTea.as_enum()]))
        .one(db)
        .await?
        .unwrap()
);
assert_eq!(
    model,
    Entity::find()
        .filter(Column::Tea.is_not_null())
        .filter(Column::Tea.is_not_in([Tea::BreakfastTea.as_enum()]))
        .one(db)
        .await?
        .unwrap()
);

@billy1624 billy1624 self-assigned this Nov 2, 2022
@billy1624 billy1624 changed the title [demo] filter rows with enum value is in list Filter rows with IS IN enum values expression Nov 2, 2022
@billy1624 billy1624 marked this pull request as ready for review November 2, 2022 05:51
@billy1624 billy1624 requested a review from tyt2y3 November 2, 2022 05:51
Copy link
Member

@ikrivosheev ikrivosheev left a comment

Choose a reason for hiding this comment

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

@billy1624 wow! Really cool! Thank you!

@tyt2y3
Copy link
Member

tyt2y3 commented Nov 14, 2022

Worthy to add on cookbook

@tyt2y3
Copy link
Member

tyt2y3 commented Nov 14, 2022

Why 476 hasn't been merged but it still works?

@billy1624
Copy link
Member Author

Worthy to add on cookbook

Good call. I just added.
But we need this PR landed before publish it.

@tyt2y3
Copy link
Member

tyt2y3 commented Nov 15, 2022

What I don't understand is, 476 has not been released yet, and I don't see any git = in this PR. So I don't think this has a dependency on that?

@billy1624
Copy link
Member Author

What I don't understand is, 476 has not been released yet, and I don't see any git = in this PR. So I don't think it has a dependency on it?

Correct! This PR does NOT depends on SeaQL/sea-query#476

@tyt2y3
Copy link
Member

tyt2y3 commented Nov 15, 2022

I see the diff now. Yeah it's much cleaner!

@tyt2y3 tyt2y3 merged commit 73e56e5 into master Nov 15, 2022
@tyt2y3 tyt2y3 deleted the demo-condition-is-in-enum-vals branch November 15, 2022 05:20
@ikrivosheev
Copy link
Member

@tyt2y3 hello! You released this, but SeaQuery doesn't... Something went wrong.

@ikrivosheev
Copy link
Member

Ups, I did not see @billy1624 comment: #1183 (comment).

Its ok)

@tyt2y3
Copy link
Member

tyt2y3 commented Nov 24, 2022

No worries

@billy1624
Copy link
Member Author

Hahaa no problem!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants