mod bounds;
mod extract;
#[cfg(test)]
mod tests;
use crate::{db::predicate::ComparePredicate, value::Value};
use std::ops::Bound;
pub(in crate::db::query::plan::planner) use extract::{
index_range_from_and, primary_key_range_from_and,
};
#[derive(Clone, Debug, Eq, PartialEq)]
struct RangeConstraint {
lower: Bound<Value>,
upper: Bound<Value>,
}
impl Default for RangeConstraint {
fn default() -> Self {
Self {
lower: Bound::Unbounded,
upper: Bound::Unbounded,
}
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
enum IndexFieldConstraint {
None,
Eq(Value),
Range(RangeConstraint),
}
#[derive(Clone)]
struct CachedCompare<'a> {
cmp: &'a ComparePredicate,
literal_compatible: bool,
}