pub struct CompiledQuery {
pub sql: String,
pub binds: Vec<BindValue>,
pub shape_hash: ShapeHash,
pub driving_table: DrivingTable,
pub hints: ExecutionHints,
}Expand description
A fully compiled query ready for execution against SQLite.
Fields§
§sql: StringThe generated SQL text.
binds: Vec<BindValue>Positional bind parameters for the SQL.
shape_hash: ShapeHashStructural shape hash for caching.
driving_table: DrivingTableThe driving table chosen by the query planner.
hints: ExecutionHintsExecution hints derived from the query shape.
Implementations§
Source§impl CompiledQuery
impl CompiledQuery
Sourcepub fn adapt_fts_for_kind(
&self,
prop_table_exists: bool,
prop_table_name: &str,
) -> (String, Vec<BindValue>)
pub fn adapt_fts_for_kind( &self, prop_table_exists: bool, prop_table_name: &str, ) -> (String, Vec<BindValue>)
Adapt a DrivingTable::FtsNodes compiled query’s SQL and binds for the
per-kind FTS property table layout.
compile_query produces SQL that references the legacy global
fts_node_properties table. At execution time the coordinator must
decide whether to rewrite that reference to the per-kind
fts_props_<kind> table (when it exists) or strip the property FTS
UNION arm entirely (when it does not).
The caller (the coordinator) performs the sqlite_master existence
check and resolves the per-kind table name. fathomdb-query has no
rusqlite dependency, so the check must remain outside this crate.
Bind positions in compile_query-generated FTS SQL are fixed:
?1= text (chunk FTS)?2= kind (chunk filter)?3= text (prop FTS)?4= kind (prop filter)?5+= fusable/residual predicates
When prop_table_exists is true the helper removes the fp.kind = ?4
clause (the per-kind table is already filtered by construction) and
drops ?4 from the bind list.
When prop_table_exists is false the helper strips the entire
property FTS UNION arm and drops both ?3 and ?4 from the bind list.
Trait Implementations§
Source§impl Clone for CompiledQuery
impl Clone for CompiledQuery
Source§fn clone(&self) -> CompiledQuery
fn clone(&self) -> CompiledQuery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompiledQuery
impl Debug for CompiledQuery
Source§impl PartialEq for CompiledQuery
impl PartialEq for CompiledQuery
impl Eq for CompiledQuery
impl StructuralPartialEq for CompiledQuery
Auto Trait Implementations§
impl Freeze for CompiledQuery
impl RefUnwindSafe for CompiledQuery
impl Send for CompiledQuery
impl Sync for CompiledQuery
impl Unpin for CompiledQuery
impl UnsafeUnpin for CompiledQuery
impl UnwindSafe for CompiledQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.