Skip to main content

icydb_core/db/query/
mod.rs

1//! Query Builder modules.
2//!
3//! Predicate semantics are defined in `docs/QUERY_BUILDER.md` and are the
4//! canonical contract for evaluation, coercion, and normalization.
5
6pub mod builder;
7pub mod diagnostics;
8pub mod intent;
9pub mod plan;
10pub mod predicate;
11mod save;
12
13pub use builder::*;
14pub use diagnostics::{
15    QueryDiagnostics, QueryExecutionDiagnostics, QueryTraceAccess, QueryTraceEvent,
16    QueryTraceExecutorKind,
17};
18pub use intent::{DeleteLimit, IntentError, Page, Query, QueryError, QueryMode};
19pub use save::*;
20
21/// Missing-row handling policy for query execution.
22#[derive(Clone, Copy, Debug, Eq, PartialEq)]
23pub enum ReadConsistency {
24    /// Missing rows are ignored (no error).
25    MissingOk,
26    /// Missing rows are treated as corruption.
27    Strict,
28}
29
30// create
31#[must_use]
32/// Build an insert `SaveQuery`.
33pub fn insert() -> SaveQuery {
34    SaveQuery::new(SaveMode::Insert)
35}
36
37// update
38#[must_use]
39/// Build an update `SaveQuery`.
40pub fn update() -> SaveQuery {
41    SaveQuery::new(SaveMode::Update)
42}
43
44// replace
45#[must_use]
46/// Build a replace `SaveQuery`.
47pub fn replace() -> SaveQuery {
48    SaveQuery::new(SaveMode::Replace)
49}