Skip to content

Implementing a custom predicate? #2905

Answered by weiznich
ecclarke42 asked this question in Q&A
Discussion options

You must be logged in to vote

I would suggest to either have an method on UserIdentifier which converts that type into a Box<dyn BoxableExpression<…, SqlType = Bool>> or to directly implement AsExpression<Bool> for UserIdentifier (Note: You need to manually implement this. The derive will not work for this case). Both allow reusing all existing FilterDsl implementations + allow to mix this with other predicates.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ecclarke42
Comment options

Answer selected by ecclarke42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants