Module bonsaidb_core::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
- Types for defining map/reduce-powered
View
s.
Structs
- A future that resolves to an entry in a
NamedCollection
. - Retrieves a list of documents from a collection, when awaited. This structure also offers functions to customize the options for the operation.
- 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.
- The namespaced name of a
Collection
. - A summary of a
Collection
. - An error from inserting a
CollectionDocument
. - A name was unable to e parsed.
- Retrieves a list of documents from a collection. This structure also offers functions to customize the options for the operation.
- A schema name. Cloning is inexpensive.
- A namespaced name.
- The name of a
Schema
. - A collection of defined collections and views.
- The name of a
View
. - A summary of a
ViewSchema
.
Enums
- A reference to a collection that has a unique name view.
Traits
- A namespaced collection of
Document<Self>
items and views. - A convenience trait for easily storing Serde-compatible types in documents.
- A type that can be used as a unique reference for a collection that implements
NamedCollection
. - A collection with a unique name column.
- Functions for creating qualified names
- Defines a group of collections that are stored into a single database.
- A collection that knows how to serialize and deserialize documents to an associated type.
Derive Macros
- Derives the
bonsaidb::core::schema::Collection
trait.#[collection(authority = "Authority", name = "Name", views = [a, b, c])]
- Derives the
bonsaidb::core::schema::Schema
trait. - Derives the
bonsaidb::core::schema::View
trait. - Derives the
bonsaidb::core::schema::ViewSchema
trait.#[view_schema(version = 1, policy = Unique, view=ViewType, mapped_key=KeyType<'doc>)]