Skip to content

Bug: Filtering by ColumnTrait.eq(None) does not filter by NULL #268

Answered by tyt2y3
Trivernis asked this question in Q&A
Discussion options

You must be logged in to vote
  • you should use is_null instead of eq None

Not sure why it was missing from ColumnTrait though, we will add it.

Meanwhile you can construct the expression yourself as in

use sea_query::Expr;

.filter(Expr::col(fruit::Column::CakeId).is_null())

Replies: 1 comment 1 reply

Comment options

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

Answer selected by tyt2y3
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
Converted from issue

This discussion was converted from issue #267 on October 23, 2021 06:52.