Skip to content

Commit

Permalink
Add query module
Browse files Browse the repository at this point in the history
Extract Query from SelectStatement so that it can be reused for delete
statement.
  • Loading branch information
kawasin73 committed Dec 5, 2023
1 parent 976fdc9 commit bfbb7e2
Show file tree
Hide file tree
Showing 6 changed files with 468 additions and 319 deletions.
4 changes: 4 additions & 0 deletions src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ impl<'a> BtreeCursor<'a> {
})
}

pub fn is_initialized(&self) -> bool {
self.initialized
}

/// Move to the specified btree table cell with the key.
///
/// If it does not exist, move to the next cell.
Expand Down
5 changes: 5 additions & 0 deletions src/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ pub enum Expression {
}

impl Expression {
#[inline]
pub fn one() -> Self {
Self::Const(ConstantValue::Integer(1))
}

pub fn from(expr: Expr, table: Option<&Table>) -> Result<Self> {
match expr {
Expr::Null => Ok(Self::Null),
Expand Down
Loading

0 comments on commit bfbb7e2

Please sign in to comment.