use crate::{
db::{
ExplainExecutionNodeDescriptor,
query::{CompiledQuery, ExplainPlan, PlannedQuery, QueryTracePlan},
response::{QueryResponse, Response},
},
error::Error,
traits::Entity,
};
use icydb_core as core;
pub struct PartialWindowLoadQuery<'a, E: Entity> {
pub(super) inner: core::db::PartialWindowLoadQuery<'a, E>,
}
impl<E: Entity> PartialWindowLoadQuery<'_, E> {
#[cfg(feature = "diagnostics")]
#[doc(hidden)]
pub fn execute_with_attribution(
&self,
) -> Result<(QueryResponse<E>, crate::db::QueryExecutionAttribution), Error> {
let (result, attribution) = self.inner.execute_with_attribution()?;
Ok((QueryResponse::from_core(result), attribution))
}
#[must_use]
pub fn trusted_read_unchecked(mut self) -> Self {
self.inner = self.inner.trusted_read_unchecked();
self
}
pub fn execute(&self) -> Result<QueryResponse<E>, Error> {
Ok(QueryResponse::from_core(self.inner.execute()?))
}
pub fn execute_rows(&self) -> Result<Response<E>, Error> {
Ok(Response::from_core(self.inner.execute_rows()?))
}
pub fn plan_hash_hex(&self) -> Result<String, Error> {
Ok(self.inner.plan_hash_hex()?)
}
pub fn trace(&self) -> Result<QueryTracePlan, Error> {
Ok(self.inner.trace()?)
}
pub fn planned(&self) -> Result<PlannedQuery<E>, Error> {
Ok(self.inner.planned()?)
}
pub fn plan(&self) -> Result<CompiledQuery<E>, Error> {
Ok(self.inner.plan()?)
}
pub fn explain(&self) -> Result<ExplainPlan, Error> {
Ok(self.inner.explain()?)
}
pub fn explain_execution(&self) -> Result<ExplainExecutionNodeDescriptor, Error> {
Ok(self.inner.explain_execution()?)
}
pub fn explain_execution_text(&self) -> Result<String, Error> {
Ok(self.inner.explain_execution_text()?)
}
pub fn explain_execution_json(&self) -> Result<String, Error> {
Ok(self.inner.explain_execution_json()?)
}
pub fn explain_execution_verbose(&self) -> Result<String, Error> {
Ok(self.inner.explain_execution_verbose()?)
}
}