Expand description
§use-nosql
Feature-gated facade crate for RustUse NoSQL-style data modeling primitives.
§Experimental
use-nosql is experimental while the workspace remains below 0.3.0.
§Example
use use_nosql::{CollectionName, DocumentId, DocumentPath, PatchOperation, PatchSet};
let collection = CollectionName::new("customers");
let document_id = DocumentId::new("customer_123");
let patch = PatchSet::new(vec![PatchOperation::set(
DocumentPath::new("profile.display_name"),
"Joshua Whalen",
)]);
assert_eq!(collection.as_str(), "customers");
assert_eq!(document_id.as_str(), "customer_123");
assert_eq!(patch.operations().len(), 1);use use_nosql::{CacheKey, CacheNamespace};
let key = CacheKey::builder()
.namespace(CacheNamespace::new("reviews"))
.segment("google-business-profile")
.segment("location")
.segment("fort-wayne")
.segment("summary")
.build();
assert_eq!(key.to_string(), "reviews:google-business-profile:location:fort-wayne:summary");use use_nosql::{Embedding, SimilarityMetric, VectorDimension, VectorId, VectorRecord};
let record = VectorRecord::new(
VectorId::new("review_789_embedding"),
Embedding::new(vec![0.012, -0.032, 0.481]),
)
.with_dimension(VectorDimension::new(3))
.unwrap()
.with_similarity_metric(SimilarityMetric::Cosine);
assert_eq!(record.dimension(), Some(VectorDimension::new(3)));§Scope
- Vendor-neutral document, key-value, wide-column, graph-store, cache, search, vector, time-series, partition, consistency, and change-event primitives.
- Feature-gated re-exports for focused child crates.
- Small data containers, labels, and validation helpers.
§Non-goals
- Database drivers or clients.
- ORM, migration, query execution, or connection-pool abstractions.
- Vendor SDK wrappers.
- Network calls or async runtime dependencies.
§License
Licensed under either Apache-2.0 or MIT. Thin facade for primitive NoSQL data modeling crates.
Re-exports§
pub use use_cache_store as cache;pub use use_change_event as change_event;pub use use_consistency as consistency;pub use use_document_path as document_path;pub use use_document_store as document_store;pub use use_graph_store as graph_store;pub use use_key_value_store as key_value;pub use use_partition_key as partition_key;pub use use_search_index as search_index;pub use use_timeseries_store as timeseries;pub use use_vector_store as vector;pub use use_wide_column as wide_column;
Structs§
- Aggregation
Window - An aggregation window duration.
- Bucket
Name - A bucket or logical storage name.
- Cache
Entry - A modeled cache entry.
- Cache
Key - A cache key.
- Cache
KeyBuilder - Builder for composed cache keys.
- Cache
Namespace - A cache namespace.
- Cache
Value - A cache value payload.
- Change
Cursor - A change stream cursor.
- Change
Event - A vendor-neutral change event.
- Change
Event Id - A change event identifier.
- Change
Sequence - A change sequence number.
- Changed
Document - A changed document reference.
- Clustering
Key - A clustering key within a partition.
- Collection
Name - A document collection name.
- Column
Family - A column-family descriptor.
- Column
Family Name - A generic column-family name.
- Column
Name - A wide-column column name.
- Column
Value - A wide-column value payload.
- Composite
Key - A composite partitioning key.
- Document
Field - A document field label.
- Document
Id - A document identifier.
- Document
Metadata - Vendor-neutral metadata for a modeled document.
- Document
Patch - Patch operations addressed to one document.
- Document
Path - A validated or raw document path such as
profile.display_name. - Document
Revision - A monotonically increasing document revision label.
- Document
Version - A document schema or application version label.
- EdgeId
- A property-graph edge identifier.
- Edge
Label - A property-graph edge label.
- Embedding
- A vector embedding payload.
- Field
Selector - A field selector label for extracting document fields.
- Graph
Edge - A property-graph edge model.
- Graph
Property - A graph property key/value pair.
- Graph
Vertex - A property-graph vertex model.
- Index
Name - A search index name.
- Invalid
Dimension Error - Error returned when a vector dimension does not match its embedding.
- Key
- A key-value store key.
- KeyNamespace
- A key namespace.
- KeyPattern
- A simple key pattern label.
- KeyPrefix
- A reusable key prefix.
- KeyRange
- A half-open or closed key range description.
- KeyValue
Entry - A key-value entry.
- Keyspace
Name - A generic wide-column keyspace name.
- Metric
Name - A metric name.
- Partition
Key - A reusable partition key.
- Patch
Set - A set of document patch operations.
- Path
Segment - One segment inside a dot-separated document path.
- Property
Key - A property key.
- Property
Value - A property value payload.
- Quorum
- A quorum count.
- Read
Concern - A read concern label.
- Replication
Factor - A replication factor count.
- Resume
Token - A change stream resume token.
- Retention
Window - A retention duration.
- Routing
Key - A routing key.
- Sampling
Interval - A sampling interval duration.
- Search
Analyzer - A search analyzer label.
- Search
Document Id - A search index document identifier.
- Search
Field - A searchable field name.
- Search
Filter - A search filter label or expression shape.
- Search
Index Document - A modeled search-index document.
- Search
Sort - A sort instruction for search results.
- Search
Term - A search term.
- Series
Id - A time-series identifier.
- Shard
Key - A shard key.
- SortKey
- A sort key.
- Time
Series Point - A single time-series point.
- Time
Series Value - A time-series numeric value.
- Timestamp
- A timestamp backed by
std::time::SystemTime. - Traversal
Label - A traversal label used by graph-store queries or projections.
- Ttl
- A positive time-to-live duration.
- Value
- A key-value store value payload.
- Vector
Collection Name - A vector collection name.
- Vector
Dimension - A vector dimension count.
- Vector
Id - A vector record identifier.
- Vector
Metadata - String metadata attached to a vector record.
- Vector
Record - A vector store record.
- Vertex
Id - A property-graph vertex identifier.
- Vertex
Label - A property-graph vertex label.
- Wide
Column Partition Key - A wide-column partition key.
- Wide
Column Row - A generic wide-column row.
- Wide
Table Name - A generic wide-column table name.
- Write
Concern - A write concern label.
Enums§
- Cache
Status - Cache entry status labels.
- Change
Event Kind - Change event kind labels.
- Consistency
Level - Consistency level labels for read/write modeling.
- Durability
Level - Durability labels for write persistence modeling.
- Eviction
Policy - Common cache eviction labels.
- Expiration
- Cache expiration modeling.
- Invalid
TtlError - Error returned when a TTL value is invalid.
- Partition
Strategy - Partition strategy labels.
- Patch
Operation - A single document patch operation.
- Path
Parse Error - Error returned when a document dot-path is invalid.
- Search
Query Shape - A conservative search query shape label.
- Similarity
Metric - Similarity metric labels used by vector stores.