diff --git a/src/transact/mod.rs b/src/transact/mod.rs index e2ad1d62..b7c6b0e5 100644 --- a/src/transact/mod.rs +++ b/src/transact/mod.rs @@ -1,2 +1,4 @@ pub(crate) mod attr; +pub(crate) mod pull; +pub(crate) mod query; pub(crate) mod triple; diff --git a/src/transact/pull.rs b/src/transact/pull.rs new file mode 100644 index 00000000..bfb27330 --- /dev/null +++ b/src/transact/pull.rs @@ -0,0 +1,25 @@ +use crate::data::attr::{Attribute, AttributeCardinality}; +use crate::data::keyword::Keyword; + +pub(crate) type PullSpecs = Vec; + +pub(crate) enum PullSpec { + None, + PullAll, + Recurse(Keyword), + Attr(AttrPullSpec), +} + +pub(crate) struct AttrPullSpec { + pub(crate) attr: Attribute, + pub(crate) reverse: bool, + pub(crate) name: Keyword, + pub(crate) cardinality: AttributeCardinality, + pub(crate) take: Option, + pub(crate) nested: PullSpecs, +} + +pub(crate) struct RecursePullSpec { + pub(crate) parent: Keyword, + pub(crate) max_depth: Option, +} diff --git a/src/transact/query.rs b/src/transact/query.rs new file mode 100644 index 00000000..cf772a25 --- /dev/null +++ b/src/transact/query.rs @@ -0,0 +1,11 @@ +use crate::data::keyword::Keyword; +use crate::transact::pull::PullSpec; + +pub(crate) struct QuerySpec { + find: Vec<(Keyword, PullSpec)>, + rules: (), + input: (), + order: (), + limit: Option, + offset: Option, +}