Module schema

Module schema 

Source
Expand description

Types for defining database schema.

Re-exports§

pub use self::view::map::Map;
pub use self::view::map::MappedValue;
pub use self::view::map::ViewMappedValue;
pub use self::view::CollectionMapReduce;
pub use self::view::DefaultViewSerialization;
pub use self::view::MapReduce;
pub use self::view::ReduceResult;
pub use self::view::SerializedView;
pub use self::view::View;
pub use self::view::ViewMapResult;
pub use self::view::ViewSchema;

Modules§

view
Types for defining map/reduce-powered Views.

Structs§

AsyncEntry
A future that resolves to an entry in a NamedCollection.
AsyncList
Retrieves a list of documents from a collection, when awaited. This structure also offers functions to customize the options for the operation.
Authority
The owner of a schema item. This should represent the company, group, or individual that created the item in question. This value is used for namespacing. Changing this after values are in use is not supported without manual migrations at this time.
CollectionName
The namespaced name of a Collection.
CollectionSummary
A summary of a Collection.
InsertError
An error from inserting a CollectionDocument.
InvalidNameError
A name was unable to e parsed.
List
Retrieves a list of documents from a collection. This structure also offers functions to customize the options for the operation.
Name
A schema name. Cloning is inexpensive.
QualifiedName
A namespaced name.
SchemaName
The name of a Schema.
SchemaSummary
A summary of a Schema/Schematic.
Schematic
A collection of defined collections and views.
ViewName
The name of a View.
ViewSummary
A summary of a ViewSchema.

Enums§

NamedReference
A reference to a collection that has a unique name view.

Traits§

Collection
A namespaced collection of Document<Self> items and views.
DefaultSerialization
A convenience trait for easily storing Serde-compatible types in documents.
Nameable
A type that can be used as a unique reference for a collection that implements NamedCollection.
NamedCollection
A collection with a unique name column.
Qualified
Functions for creating qualified names
Schema
Defines a group of collections that are stored into a single database.
SerializedCollection
A collection that knows how to serialize and deserialize documents to an associated type.

Derive Macros§

Collection
Derives the bonsaidb::core::schema::Collection trait. #[collection(authority = "Authority", name = "Name", views = [a, b, c])]
Schema
Derives the bonsaidb::core::schema::Schema trait.
View
Derives the bonsaidb::core::schema::View trait.
ViewSchema
Derives the bonsaidb::core::schema::ViewSchema trait. #[view_schema(version = 1, policy = Unique, view=ViewType, mapped_key=KeyType<'doc>)]