Skip to content

Conversation

@Huliiiiii
Copy link
Member

@Huliiiiii Huliiiiii changed the title Optimaize exists Optimize exists Jan 12, 2026
Copy link
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
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
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 on lines -280 to -282
async fn exists(self, db: &'db C) -> Result<bool, DbErr>
where
Self: Send + Sized,
Copy link
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
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
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
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