mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-20 08:34:19 +01:00
Small nits and code clean ups
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user