pub enum DatabaseRequest {
Show 19 variants Get { collection: CollectionName, id: DocumentId, }, GetMultiple { collection: CollectionName, ids: Vec<DocumentId>, }, List { collection: CollectionName, ids: Range<DocumentId>, order: Sort, limit: Option<usize>, }, Query { view: ViewName, key: Option<QueryKey<Bytes>>, order: Sort, limit: Option<usize>, access_policy: AccessPolicy, with_docs: bool, }, Reduce { view: ViewName, key: Option<QueryKey<Bytes>>, access_policy: AccessPolicy, grouped: bool, }, DeleteDocs { view: ViewName, key: Option<QueryKey<Bytes>>, access_policy: AccessPolicy, }, ApplyTransaction { transaction: Transaction, }, ListExecutedTransactions { starting_id: Option<u64>, result_limit: Option<usize>, }, LastTransactionId, CreateSubscriber, Publish { topic: String, payload: Bytes, }, PublishToAll { topics: Vec<String>, payload: Bytes, }, SubscribeTo { subscriber_id: u64, topic: String, }, UnsubscribeFrom { subscriber_id: u64, topic: String, }, UnregisterSubscriber { subscriber_id: u64, }, ExecuteKeyOperation(KeyOperation), CompactCollection { name: CollectionName, }, CompactKeyValueStore, Compact,
}
Expand description

A database-related request.

Variants

Get

Fields

collection: CollectionName

The collection of the document.

id: DocumentId

The id of the document.

Retrieve a single document.

GetMultiple

Fields

collection: CollectionName

The collection of the documents.

ids: Vec<DocumentId>

The ids of the documents.

Retrieve multiple documents.

List

Fields

collection: CollectionName

The collection of the documents.

ids: Range<DocumentId>

The range of ids to list.

order: Sort

The order for the query into the collection.

limit: Option<usize>

The maximum number of results to return.

Retrieve multiple documents.

Query

Fields

view: ViewName

The name of the view.

key: Option<QueryKey<Bytes>>

The filter for the view.

order: Sort

The order for the query into the view.

limit: Option<usize>

The maximum number of results to return.

access_policy: AccessPolicy

The access policy for the query.

with_docs: bool

If true, DatabaseResponse::ViewMappingsWithDocs will be returned. If false, DatabaseResponse::ViewMappings will be returned.

Queries a view.

Reduce

Fields

view: ViewName

The name of the view.

key: Option<QueryKey<Bytes>>

The filter for the view.

access_policy: AccessPolicy

The access policy for the query.

grouped: bool

Whether to return a single value or values grouped by unique key. If true, DatabaseResponse::ViewGroupedReduction will be returned. If false, DatabaseResponse::ViewReduction is returned.

Reduces a view.

DeleteDocs

Fields

view: ViewName

The name of the view.

key: Option<QueryKey<Bytes>>

The filter for the view.

access_policy: AccessPolicy

The access policy for the query.

Deletes the associated documents resulting from the view query.

ApplyTransaction

Fields

transaction: Transaction

The trasnaction to apply.

Applies a transaction.

ListExecutedTransactions

Fields

starting_id: Option<u64>

The starting transaction id.

result_limit: Option<usize>

The maximum number of results.

Lists executed transactions.

LastTransactionId

Queries the last transaction id.

CreateSubscriber

Creates a PubSub Subscriber

Publish

Fields

topic: String

The topics to publish to.

payload: Bytes

The payload to publish.

Publishes payload to all subscribers of topic.

PublishToAll

Fields

topics: Vec<String>

The topics to publish to.

payload: Bytes

The payload to publish.

Publishes payload to all subscribers of all topics.

SubscribeTo

Fields

subscriber_id: u64

The id of the Subscriber.

topic: String

The topic to subscribe to.

Subscribes subscriber_id to messages for topic.

UnsubscribeFrom

Fields

subscriber_id: u64

The id of the Subscriber.

topic: String

The topic to unsubscribe from.

Unsubscribes subscriber_id from messages for topic.

UnregisterSubscriber

Fields

subscriber_id: u64

The id of the Subscriber.

Unregisters the subscriber.

ExecuteKeyOperation(KeyOperation)

Excutes a key-value store operation.

CompactCollection

Fields

name: CollectionName

The name of the collection to compact.

Compacts the collection.

CompactKeyValueStore

Compacts the key-value store.

Compact

Compacts the entire database.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.