mod canonical;
mod identity;
mod local;
mod names;
mod provenance;
mod values;
pub use canonical::{
CanonicalComparison, CanonicalContents, CanonicalEmbedding, CanonicalError,
CanonicalFingerprint, CanonicalStats, GraphProperty, MAX_CANONICAL_SCRATCH,
compare_canonical_streams,
};
pub mod storage;
#[cfg(feature = "graph-cypher")]
pub(crate) mod retrieval;
#[cfg(feature = "graph-cypher")]
mod graph_store;
#[cfg(all(feature = "graph-cypher", any(test, feature = "test-seams")))]
pub(crate) use graph_store::commit_recovery_test_support;
#[cfg(feature = "graph-cypher")]
pub use graph_store::{
GraphBatch, GraphGetOptions, GraphMaintenancePolicy, GraphMaintenanceReport, GraphNodeDocument,
GraphNodesResult, GraphPlanBacking, GraphQueryPlan, GraphRelationshipsResult, GraphStoreError,
GraphStoreErrorKind, GraphWriteOutcome, GraphWriteResult,
};
pub use identity::{
EntityId, EntityKind, GraphGeneration, GraphRevision, NodeId, RelId, StoreInstanceId,
};
pub use local::{LocalNodeRef, LocalRefs, LocalRelRef, NodeRef, RelRef, with_local_refs};
pub use names::{ApplicationKey, EntityMetadata, GraphName};
pub use provenance::{
ExpectedGraphState, GraphDeleteMode, GraphOperation, OperationFields, OperationProvenance,
ReplayEvidence, compare_replay_evidence,
};
pub use values::{GraphVector, PropertyData, PropertyValue};
pub const MAX_GRAPH_INPUT_BYTES: usize = 8 * 1024 * 1024;
pub const MAX_PROPERTY_LIST_ELEMENTS: usize = 524_288;
pub const MAX_GRAPH_CHANGES: usize = 16_384;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum DomainError {
ZeroIdentity,
ZeroRevision,
RevisionOverflow,
InvalidUtf8,
InputTooLarge,
EntityKindMismatch,
NonemptyUntypedList,
ListTooLong,
VectorDimensions,
NonfiniteVector,
LocalReferenceOutOfRange,
}
impl std::fmt::Display for DomainError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(match self {
Self::ZeroIdentity => "graph identity must be nonzero",
Self::ZeroRevision => "graph revision must be positive",
Self::RevisionOverflow => "graph revision overflow",
Self::InvalidUtf8 => "graph name is not UTF-8",
Self::InputTooLarge => "graph input exceeds the byte limit",
Self::EntityKindMismatch => "graph key and entity kinds differ",
Self::NonemptyUntypedList => "untyped graph list must be empty",
Self::ListTooLong => "graph property list exceeds the element limit",
Self::VectorDimensions => "graph vector dimensions do not match a positive declaration",
Self::NonfiniteVector => "graph vector coordinates must be finite",
Self::LocalReferenceOutOfRange => "graph batch-local reference is out of range",
})
}
}
impl std::error::Error for DomainError {}
#[cfg(test)]
mod tests;
pub mod catalog;
mod key_lifecycle;
pub use canonical::EntityShape;
pub use key_lifecycle::{
BatchClassification, BatchDisposition, BatchTarget, CanonicalRecord, CurrentEntity, CypherEdit,
KeyDecision, KeyLifecycleError, KeyRequest, KeyState, PendingKeyChange, classify_cypher,
classify_key, summarize_key_batch, validate_distinct_targets,
};
pub mod query;
pub mod wal;
pub mod resources;
pub mod staging;
mod utf8;
pub use utf8::{Utf8CheckError, checked_utf8};