Skip to content

Optimize exists#2909

Merged
tyt2y3 merged 1 commit intoSeaQL:masterfrom
Huliiiiii:entity-exists
Jan 17, 2026
Merged

Optimize exists#2909
tyt2y3 merged 1 commit intoSeaQL:masterfrom
Huliiiiii:entity-exists

Conversation

@Huliiiiii
Copy link
Copy Markdown
Member

@Huliiiiii Huliiiiii changed the title Optimaize exists Optimize exists Jan 12, 2026
Copy link
Copy Markdown
Member

@tyt2y3 tyt2y3 left a comment

Choose a reason for hiding this comment

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

do we need to add a test case or there is already coverage?

@Huliiiiii Huliiiiii force-pushed the entity-exists branch 5 times, most recently from ac2aad9 to b6fd8fa Compare January 14, 2026 18:06
}
}

#[async_trait::async_trait]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
#[async_trait::async_trait]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

async fn in trait can’t mark the future as Send and Sync, but we can use impl future instead. Which do you prefer?

Comment thread src/executor/paginator.rs
Comment on lines -280 to -282
async fn exists(self, db: &'db C) -> Result<bool, DbErr>
where
Self: Send + Sized,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am thinking whether we should keep this, at least leave behind a deprecated notice?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It was added in v2.0, so I think we can move it directly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

haha, didn't even remember!

@tyt2y3 tyt2y3 merged commit d6bea44 into SeaQL:master Jan 17, 2026
38 checks passed
@Huliiiiii Huliiiiii deleted the entity-exists branch January 17, 2026 17:46
@github-actions
Copy link
Copy Markdown

🎉 Released In 2.0.0-rc.29 🎉

Huge thanks for the contribution!
This feature has now been released, so it's a great time to upgrade.
Show some love with a ⭐ on our repo, every star counts!

strwbrr-fox pushed a commit to strwbrr-fox/sea-orm that referenced this pull request Jan 27, 2026
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.

Redundant query in PaginatorTrait::exists()

2 participants