Small nits and code clean ups

This commit is contained in:
Diego Reis
2025-10-09 12:14:20 -03:00
parent b8f8a87007
commit d2d265a06f
2 changed files with 23 additions and 27 deletions

View File

@@ -542,6 +542,17 @@ impl Expr {
pub fn raise(resolve_type: ResolveType, expr: Option<Expr>) -> Expr {
Expr::Raise(resolve_type, expr.map(Box::new))
}
pub fn can_be_null(&self) -> bool {
// todo: better handling columns. Check sqlite3ExprCanBeNull
match self {
Expr::Literal(literal) => !matches!(
literal,
Literal::Numeric(_) | Literal::String(_) | Literal::Blob(_)
),
_ => true,
}
}
}
/// SQL literal