Skip to main content

Crate use_nosql

Crate use_nosql 

Source
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§

AggregationWindow
An aggregation window duration.
BucketName
A bucket or logical storage name.
CacheEntry
A modeled cache entry.
CacheKey
A cache key.
CacheKeyBuilder
Builder for composed cache keys.
CacheNamespace
A cache namespace.
CacheValue
A cache value payload.
ChangeCursor
A change stream cursor.
ChangeEvent
A vendor-neutral change event.
ChangeEventId
A change event identifier.
ChangeSequence
A change sequence number.
ChangedDocument
A changed document reference.
ClusteringKey
A clustering key within a partition.
CollectionName
A document collection name.
ColumnFamily
A column-family descriptor.
ColumnFamilyName
A generic column-family name.
ColumnName
A wide-column column name.
ColumnValue
A wide-column value payload.
CompositeKey
A composite partitioning key.
DocumentField
A document field label.
DocumentId
A document identifier.
DocumentMetadata
Vendor-neutral metadata for a modeled document.
DocumentPatch
Patch operations addressed to one document.
DocumentPath
A validated or raw document path such as profile.display_name.
DocumentRevision
A monotonically increasing document revision label.
DocumentVersion
A document schema or application version label.
EdgeId
A property-graph edge identifier.
EdgeLabel
A property-graph edge label.
Embedding
A vector embedding payload.
FieldSelector
A field selector label for extracting document fields.
GraphEdge
A property-graph edge model.
GraphProperty
A graph property key/value pair.
GraphVertex
A property-graph vertex model.
IndexName
A search index name.
InvalidDimensionError
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.
KeyValueEntry
A key-value entry.
KeyspaceName
A generic wide-column keyspace name.
MetricName
A metric name.
PartitionKey
A reusable partition key.
PatchSet
A set of document patch operations.
PathSegment
One segment inside a dot-separated document path.
PropertyKey
A property key.
PropertyValue
A property value payload.
Quorum
A quorum count.
ReadConcern
A read concern label.
ReplicationFactor
A replication factor count.
ResumeToken
A change stream resume token.
RetentionWindow
A retention duration.
RoutingKey
A routing key.
SamplingInterval
A sampling interval duration.
SearchAnalyzer
A search analyzer label.
SearchDocumentId
A search index document identifier.
SearchField
A searchable field name.
SearchFilter
A search filter label or expression shape.
SearchIndexDocument
A modeled search-index document.
SearchSort
A sort instruction for search results.
SearchTerm
A search term.
SeriesId
A time-series identifier.
ShardKey
A shard key.
SortKey
A sort key.
TimeSeriesPoint
A single time-series point.
TimeSeriesValue
A time-series numeric value.
Timestamp
A timestamp backed by std::time::SystemTime.
TraversalLabel
A traversal label used by graph-store queries or projections.
Ttl
A positive time-to-live duration.
Value
A key-value store value payload.
VectorCollectionName
A vector collection name.
VectorDimension
A vector dimension count.
VectorId
A vector record identifier.
VectorMetadata
String metadata attached to a vector record.
VectorRecord
A vector store record.
VertexId
A property-graph vertex identifier.
VertexLabel
A property-graph vertex label.
WideColumnPartitionKey
A wide-column partition key.
WideColumnRow
A generic wide-column row.
WideTableName
A generic wide-column table name.
WriteConcern
A write concern label.

Enums§

CacheStatus
Cache entry status labels.
ChangeEventKind
Change event kind labels.
ConsistencyLevel
Consistency level labels for read/write modeling.
DurabilityLevel
Durability labels for write persistence modeling.
EvictionPolicy
Common cache eviction labels.
Expiration
Cache expiration modeling.
InvalidTtlError
Error returned when a TTL value is invalid.
PartitionStrategy
Partition strategy labels.
PatchOperation
A single document patch operation.
PathParseError
Error returned when a document dot-path is invalid.
SearchQueryShape
A conservative search query shape label.
SimilarityMetric
Similarity metric labels used by vector stores.