pub struct CollectionContract {Show 30 fields
pub name: String,
pub description: Option<String>,
pub description_generated: bool,
pub declared_model: CollectionModel,
pub schema_mode: SchemaMode,
pub origin: ContractOrigin,
pub version: u32,
pub created_at_unix_ms: u128,
pub updated_at_unix_ms: u128,
pub default_ttl_ms: Option<u64>,
pub vector_dimension: Option<usize>,
pub vector_metric: Option<DistanceMetric>,
pub context_index_fields: Vec<String>,
pub declared_columns: Vec<DeclaredColumnContract>,
pub table_def: Option<TableDef>,
pub timestamps_enabled: bool,
pub context_index_enabled: bool,
pub metrics_raw_retention_ms: Option<u64>,
pub metrics_rollup_policies: Vec<String>,
pub metrics_tenant_identity: Option<String>,
pub metrics_namespace: Option<String>,
pub append_only: bool,
pub subscriptions: Vec<SubscriptionDescriptor>,
pub analytics_config: Vec<AnalyticsViewDescriptor>,
pub session_key: Option<String>,
pub session_gap_ms: Option<u64>,
pub retention_duration_ms: Option<u64>,
pub analytical_storage: Option<AnalyticalStorageConfig>,
pub graph_contract: Option<GraphContract>,
pub ai_policy: Option<AiPolicy>,
}Fields§
§name: String§description: Option<String>§description_generated: bool§declared_model: CollectionModel§schema_mode: SchemaMode§origin: ContractOrigin§version: u32§created_at_unix_ms: u128§updated_at_unix_ms: u128§default_ttl_ms: Option<u64>§vector_dimension: Option<usize>§vector_metric: Option<DistanceMetric>§context_index_fields: Vec<String>§declared_columns: Vec<DeclaredColumnContract>§table_def: Option<TableDef>§timestamps_enabled: boolEnabled by CREATE TABLE ... WITH timestamps = true. When true,
the runtime auto-populates two user-visible columns
created_at + updated_at (BIGINT unix-ms) sourced from the
UnifiedEntity::created_at/updated_at fields. created_at is
immutable after insert; updated_at is bumped on every mutation.
context_index_enabled: boolEnabled by CREATE TABLE ... WITH context_index = true (or by
naming specific context_index_fields). When true, every INSERT
tokenises the row’s text fields and populates the global context
index that backs SEARCH CONTEXT / SEARCH SIMILAR TEXT / ASK
(RAG). When false (default), inserts skip the tokenisation +
3-way RwLock write storm entirely — ~800 ns faster per insert,
and SEARCH returns empty for this collection.
Opt-in by design: pure OLTP tables (accounts, orders, events) pay zero indexing tax; search-oriented tables (articles, docs) flip the switch at CREATE time.
metrics_raw_retention_ms: Option<u64>Metrics collections are backed by time-series storage but carry a metrics-specific raw sample retention contract.
metrics_rollup_policies: Vec<String>Metrics rollup tiers declared by CREATE METRICS ... DOWNSAMPLE.
metrics_tenant_identity: Option<String>Metrics tenant identity source. Defaults to current tenant context and can be declared as a stable identity path for future ingestion slices.
metrics_namespace: Option<String>Metrics namespace identity. v0 starts with a default namespace so series identity is namespace-aware before Prometheus ingestion exists.
append_only: boolEnabled by CREATE TABLE ... APPEND ONLY or WITH (append_only = true). When true, the runtime rejects
UPDATE and DELETE against this collection at parse time
with a clear error — the operator’s immutability intent
becomes a first-class catalog fact rather than an RLS-shaped
approximation. Default false so legacy DDL keeps its
mutable semantics.
subscriptions: Vec<SubscriptionDescriptor>Declarative subscriptions created by WITH EVENTS. This is
metadata only in #291; event emission is wired by the outbox slice.
analytics_config: Vec<AnalyticsViewDescriptor>Analytics views declared by CREATE GRAPH ... WITH ANALYTICS (...).
Persisted as part of the contract so each enabled <graph>.<output>
virtual view survives restarts and crash recovery (issue #800).
session_key: Option<String>CREATE TIMESERIES ... WITH SESSION_KEY <col> — the column the
SESSIONIZE operator partitions by when no key is supplied at
query-time. None for non-timeseries collections and for
timeseries created without the clause. Issue #576 slice 1.
session_gap_ms: Option<u64>CREATE TIMESERIES ... SESSION_GAP <duration> — the default
inactivity gap (milliseconds) the SESSIONIZE operator uses to
close a session when no gap is supplied at query-time. None
for non-timeseries collections and for timeseries created
without the clause. Issue #576 slice 1.
retention_duration_ms: Option<u64>ALTER COLLECTION ... SET RETENTION <duration> — declarative
retention policy in milliseconds. None means retention is
not enforced. Reads filter out rows older than now - retention_duration_ms by the collection’s timestamp column.
Issue #580 — DeclarativeRetention slice 1.
analytical_storage: Option<AnalyticalStorageConfig>Analytical-storage seam (PRD #850, Phase 1). When present and
columnar = true, sealing this collection’s hypertable chunks
routes to the columnar ColumnBlock writer; None (the default)
keeps the row engine. Decodes to None on sidecars written before
the feature.
graph_contract: Option<GraphContract>Per-collection AI policy declared by WITH (EMBED|MODERATE|VISION (...)) (PRD #1267, issue #1271). None when no AI clause is
present, and decodes to None on sidecars written before the
feature (versioned/migrated with the schema). Validated against
the provider capability matrix (#1269) at DDL execution time.
ai_policy: Option<AiPolicy>Trait Implementations§
Source§impl Clone for CollectionContract
impl Clone for CollectionContract
Source§fn clone(&self) -> CollectionContract
fn clone(&self) -> CollectionContract
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Forget for CollectionContract
impl Freeze for CollectionContractwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<DeclaredColumnContract>: Freeze,
PhantomData<ColumnDef>: Freeze,
PhantomData<IndexDef>: Freeze,
PhantomData<Constraint>: Freeze,
PhantomData<SubscriptionDescriptor>: Freeze,
PhantomData<AnalyticsViewDescriptor>: Freeze,
*const LeafNode<String, GraphVertexContract> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, GraphVertexContract)>>: Freeze,
*const LeafNode<String, GraphEdgeContract> is !null: Freeze,
PhantomData<Box<(String, GraphEdgeContract)>>: Freeze,
impl Move for CollectionContract
impl RefUnwindSafe for CollectionContract
impl Send for CollectionContractwhere
RawVecInner: Send,
BoxRaw<SqlTypeName>: Send,
Arc<str>: Send,
Arc<Expr>: Send,
Arc<[String]>: Send,
RawTable<(String, String)>: Send,
NodeRef<Owned, String, GraphVertexContract, LeafOrInternal>: Send,
BoxRaw<(String, GraphVertexContract)>: Send,
NodeRef<Owned, String, GraphEdgeContract, LeafOrInternal>: Send,
BoxRaw<(String, GraphEdgeContract)>: Send,
impl Sync for CollectionContractwhere
RawVecInner: Sync,
BoxRaw<SqlTypeName>: Sync,
Arc<str>: Sync,
Arc<Expr>: Sync,
Arc<[String]>: Sync,
RawTable<(String, String)>: Sync,
NodeRef<Owned, String, GraphVertexContract, LeafOrInternal>: Sync,
BoxRaw<(String, GraphVertexContract)>: Sync,
NodeRef<Owned, String, GraphEdgeContract, LeafOrInternal>: Sync,
BoxRaw<(String, GraphEdgeContract)>: Sync,
impl Unpin for CollectionContractwhere
*const u8 is !null: Unpin,
Box<SqlTypeName>: Unpin,
Arc<str>: Unpin,
Arc<Expr>: Unpin,
Arc<[String]>: Unpin,
*const LeafNode<String, GraphVertexContract> is !null: Unpin,
Box<(String, GraphVertexContract)>: Unpin,
*const LeafNode<String, GraphEdgeContract> is !null: Unpin,
Box<(String, GraphEdgeContract)>: Unpin,
impl UnsafeUnpin for CollectionContractwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<DeclaredColumnContract>: UnsafeUnpin,
PhantomData<ColumnDef>: UnsafeUnpin,
PhantomData<IndexDef>: UnsafeUnpin,
PhantomData<Constraint>: UnsafeUnpin,
PhantomData<SubscriptionDescriptor>: UnsafeUnpin,
PhantomData<AnalyticsViewDescriptor>: UnsafeUnpin,
*const LeafNode<String, GraphVertexContract> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, GraphVertexContract)>>: UnsafeUnpin,
*const LeafNode<String, GraphEdgeContract> is !null: UnsafeUnpin,
PhantomData<Box<(String, GraphEdgeContract)>>: UnsafeUnpin,
impl UnwindSafe for CollectionContractwhere
RawVecInner: UnwindSafe,
BoxRaw<SqlTypeName>: UnwindSafe,
Arc<str>: UnwindSafe,
Arc<Expr>: UnwindSafe,
Arc<[String]>: UnwindSafe,
HashMap<String, String>: UnwindSafe,
BTreeMap<String, GraphVertexContract>: UnwindSafe,
BTreeMap<String, GraphEdgeContract>: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request