SoliDBClient

Struct SoliDBClient 

Source
pub struct SoliDBClient { /* private fields */ }

Implementations§

Source§

impl SoliDBClient

Source

pub async fn batch( &mut self, commands: Vec<Command>, ) -> Result<Vec<Response>, DriverError>

Source

pub async fn bulk_insert( &mut self, database: &str, collection: &str, documents: Vec<Value>, ) -> Result<usize, DriverError>

Source§

impl SoliDBClient

Source

pub async fn list_collections( &mut self, database: &str, ) -> Result<Vec<String>, DriverError>

Source

pub async fn create_collection( &mut self, database: &str, name: &str, collection_type: Option<&str>, ) -> Result<(), DriverError>

Source

pub async fn delete_collection( &mut self, database: &str, name: &str, ) -> Result<(), DriverError>

Source

pub async fn collection_stats( &mut self, database: &str, collection: &str, ) -> Result<Value, DriverError>

Source§

impl SoliDBClient

Source

pub async fn list_databases(&mut self) -> Result<Vec<String>, DriverError>

Source

pub async fn create_database(&mut self, name: &str) -> Result<(), DriverError>

Source

pub async fn delete_database(&mut self, name: &str) -> Result<(), DriverError>

Source§

impl SoliDBClient

Source

pub async fn get( &mut self, database: &str, collection: &str, key: &str, ) -> Result<Value, DriverError>

Source

pub async fn insert( &mut self, database: &str, collection: &str, key: Option<&str>, document: Value, ) -> Result<Value, DriverError>

Source

pub async fn update( &mut self, database: &str, collection: &str, key: &str, document: Value, merge: bool, ) -> Result<Value, DriverError>

Source

pub async fn delete( &mut self, database: &str, collection: &str, key: &str, ) -> Result<(), DriverError>

Source

pub async fn list( &mut self, database: &str, collection: &str, limit: Option<usize>, offset: Option<usize>, ) -> Result<(Vec<Value>, usize), DriverError>

Source§

impl SoliDBClient

Source

pub async fn create_index( &mut self, database: &str, collection: &str, name: &str, fields: Vec<String>, unique: bool, sparse: bool, ) -> Result<(), DriverError>

Source

pub async fn delete_index( &mut self, database: &str, collection: &str, name: &str, ) -> Result<(), DriverError>

Source

pub async fn list_indexes( &mut self, database: &str, collection: &str, ) -> Result<Vec<Value>, DriverError>

Source§

impl SoliDBClient

Source

pub async fn query( &mut self, database: &str, sdbql: &str, bind_vars: Option<HashMap<String, Value>>, ) -> Result<Vec<Value>, DriverError>

Source

pub async fn explain( &mut self, database: &str, sdbql: &str, bind_vars: Option<HashMap<String, Value>>, ) -> Result<Value, DriverError>

Source§

impl SoliDBClient

Source

pub async fn begin_transaction( &mut self, database: &str, isolation_level: Option<IsolationLevel>, ) -> Result<String, DriverError>

Source

pub async fn commit(&mut self) -> Result<(), DriverError>

Source

pub async fn rollback(&mut self) -> Result<(), DriverError>

Source

pub fn in_transaction(&self) -> bool

Source

pub fn transaction_id(&self) -> Option<&str>

Source§

impl SoliDBClient

Source

pub async fn connect(addr: &str) -> Result<Self, DriverError>

Source

pub async fn ping(&mut self) -> Result<i64, DriverError>

Source

pub async fn auth( &mut self, database: &str, username: &str, password: &str, ) -> Result<(), DriverError>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.