use crate::{
db::{
DbSession, Query, QueryError,
query::intent::{CompiledQuery, PlannedQuery},
},
traits::{CanisterKind, EntityKind},
};
impl<C: CanisterKind> DbSession<C> {
pub(in crate::db) fn compile_query_with_visible_indexes<E>(
&self,
query: &Query<E>,
) -> Result<CompiledQuery<E>, QueryError>
where
E: EntityKind<Canister = C>,
{
self.map_cached_shared_query_plan_for_entity(query, CompiledQuery::<E>::from_plan)
}
pub(in crate::db) fn planned_query_with_visible_indexes<E>(
&self,
query: &Query<E>,
) -> Result<PlannedQuery<E>, QueryError>
where
E: EntityKind<Canister = C>,
{
self.map_cached_shared_query_plan_for_entity(query, PlannedQuery::<E>::from_plan)
}
}