Trait indradb::Datastore[][src]

pub trait Datastore {
    type Trans: Transaction;
    fn sync(&self) -> Result<()>;
fn transaction(&self) -> Result<Self::Trans>; fn bulk_insert<I>(&self, items: I) -> Result<()>
    where
        I: Iterator<Item = BulkInsertItem>
, { ... } }

Specifies a datastore implementation.

Errors

All methods may return an error if something unexpected happens - e.g. if there was a problem connecting to the underlying database.

Associated Types

Loading content...

Required methods

fn sync(&self) -> Result<()>[src]

Syncs persisted content. Depending on the datastore implementation, this has different meanings - including potentially being a no-op.

fn transaction(&self) -> Result<Self::Trans>[src]

Creates a new transaction.

Loading content...

Provided methods

fn bulk_insert<I>(&self, items: I) -> Result<()> where
    I: Iterator<Item = BulkInsertItem>, 
[src]

Bulk inserts many vertices, edges, and/or properties.

Note that datastores have discretion on how to approach safeguard vs performance tradeoffs. In particular:

  • If the datastore is disk-backed, it may or may not flush before returning.
  • The datastore might not verify for correctness; e.g., it might not ensure that the relevant vertices exist before inserting an edge. If you want maximum protection, use the equivalent functions in transactions, which will provide more safeguards.

Arguments

  • items: The items to insert.
Loading content...

Implementors

Loading content...