pub struct CompiledQuery {
pub sql: String,
pub binds: Vec<BindValue>,
pub shape_hash: ShapeHash,
pub driving_table: DrivingTable,
pub hints: ExecutionHints,
pub semantic_search: Option<CompiledSemanticSearch>,
pub raw_vector_search: Option<CompiledRawVectorSearch>,
}Expand description
A fully compiled query ready for execution against SQLite.
Pack F1.75: carries optional CompiledSemanticSearch /
CompiledRawVectorSearch sidecars. When either is Some, the
coordinator dispatches the query through the dedicated
execute_compiled_semantic_search / execute_compiled_raw_vector_search
executor instead of running sql as a plain node scan. The sql /
binds fields remain populated with a no-op node-scan plan so that
explain paths keep working without the sidecar.
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.
semantic_search: Option<CompiledSemanticSearch>Pack F1.75 sidecar: when populated, the coordinator dispatches
through execute_compiled_semantic_search.
raw_vector_search: Option<CompiledRawVectorSearch>Pack F1.75 sidecar: when populated, the coordinator dispatches
through execute_compiled_raw_vector_search.
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 more