mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-16 13:34:33 +01:00
Operation: add method index() to retrieve used index, if any
This commit is contained in:
@@ -281,6 +281,17 @@ pub enum Operation {
|
||||
},
|
||||
}
|
||||
|
||||
impl Operation {
|
||||
pub fn index(&self) -> Option<&Arc<Index>> {
|
||||
match self {
|
||||
Operation::Scan { index, .. } => index.as_ref(),
|
||||
Operation::Search(Search::RowidEq { .. }) => None,
|
||||
Operation::Search(Search::Seek { index, .. }) => index.as_ref(),
|
||||
Operation::Subquery { .. } => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TableReference {
|
||||
/// Returns the btree table for this table reference, if it is a BTreeTable.
|
||||
pub fn btree(&self) -> Option<Rc<BTreeTable>> {
|
||||
|
||||
Reference in New Issue
Block a user