icydb_core/db/executor/
query_plan.rs1use crate::{
2 db::{
3 executor::ExecutablePlan,
4 query::{
5 fluent::{delete::FluentDeleteQuery, load::FluentLoadQuery},
6 intent::{PlannedQuery, Query, QueryError},
7 },
8 },
9 traits::EntityKind,
10};
11
12impl<E: EntityKind> From<PlannedQuery<E>> for ExecutablePlan<E> {
13 fn from(value: PlannedQuery<E>) -> Self {
14 Self::new(value.into_inner())
15 }
16}
17
18impl<E: EntityKind> Query<E> {
19 pub fn plan(&self) -> Result<ExecutablePlan<E>, QueryError> {
21 self.planned().map(ExecutablePlan::from)
22 }
23}
24
25impl<E: EntityKind> FluentLoadQuery<'_, E> {
26 pub fn plan(&self) -> Result<ExecutablePlan<E>, QueryError> {
28 self.planned().map(ExecutablePlan::from)
29 }
30}
31
32impl<E: EntityKind> FluentDeleteQuery<'_, E> {
33 pub fn plan(&self) -> Result<ExecutablePlan<E>, QueryError> {
35 self.planned().map(ExecutablePlan::from)
36 }
37}