[][src]Struct arangors::database::Database

pub struct Database<'a, C: ClientExt> { /* fields omitted */ }

Implementations

impl<'a, C: ClientExt> Database<'a, C>[src]

pub async fn accessible_collections<'_>(
    &'_ self
) -> Result<Vec<Info>, ClientError>
[src]

Retrieve all collections of this database.

Note

this function would make a request to arango server.

pub fn get_url(&self) -> &Url[src]

pub fn get_session(&self) -> Arc<C>[src]

pub async fn collection<'_, '_>(
    &'_ self,
    name: &'_ str
) -> Result<Collection<'a, C>, ClientError>
[src]

Get collection object with name.

Note

this function would make a request to arango server.

pub async fn create_edge_collection<'_, '_, '_>(
    &'_ self,
    _name: &'_ str
) -> Collection<'_, C>
[src]

pub async fn create_collection<'_, '_, '_>(
    &'_ mut self,
    name: &'_ str
) -> Result<Collection<'_, C>, ClientError>
[src]

Create a collection via HTTP request.

Return a collection object if success.

Note

this function would make a request to arango server.

pub async fn drop_collection<'_, '_>(
    &'_ mut self,
    name: &'_ str
) -> Result<String, ClientError>
[src]

Drops a collection

pub async fn arango_version<'_>(&'_ self) -> Result<Version, ClientError>[src]

Get the version remote arango database server

Note

this function would make a request to arango server.

pub async fn info<'_>(&'_ self) -> Result<DatabaseDetails, ClientError>[src]

Get information of current database.

Note

this function would make a request to arango server.

pub async fn aql_query_batch<R, '_, '_>(
    &'_ self,
    aql: AqlQuery<'_>
) -> Result<Cursor<R>, ClientError> where
    R: DeserializeOwned + Debug
[src]

Execute aql query, return a cursor if succeed. The major advantage of batch query is that cursors contain more information and stats about the AQL query, and users can fetch results in batch to save memory resources on clients.

Note

this function would make a request to arango server.

pub async fn aql_next_batch<R, '_, '_>(
    &'_ self,
    cursor_id: &'_ str
) -> Result<Cursor<R>, ClientError> where
    R: DeserializeOwned + Debug
[src]

Get next batch given the cursor id.

Note

this function would make a request to arango server.

pub async fn aql_query<R, '_, '_>(
    &'_ self,
    aql: AqlQuery<'_>
) -> Result<Vec<R>, ClientError> where
    R: DeserializeOwned + Debug
[src]

Execute AQL query fetch all results.

DO NOT do this when the count of results is too large that network or memory resources cannot afford.

DO NOT set a small batch size, otherwise clients will have to make many HTTP requests.

Note

this function would make a request to arango server.

pub async fn aql_str<R, '_, '_>(
    &'_ self,
    query: &'_ str
) -> Result<Vec<R>, ClientError> where
    R: DeserializeOwned + Debug
[src]

Similar to aql_query, except that this method only accept a string of AQL query.

Note

this function would make a request to arango server.

pub async fn aql_bind_vars<R, '_, '_, '_>(
    &'_ self,
    query: &'_ str,
    bind_vars: HashMap<&'_ str, Value>
) -> Result<Vec<R>, ClientError> where
    R: DeserializeOwned + Debug
[src]

Similar to aql_query, except that this method only accept a string of AQL query, with additional bind vars.

Note

this function would make a request to arango server.

Trait Implementations

impl<'a, C: Clone + ClientExt> Clone for Database<'a, C>[src]

impl<'a, C: Debug + ClientExt> Debug for Database<'a, C>[src]

Auto Trait Implementations

impl<'a, C> RefUnwindSafe for Database<'a, C> where
    C: RefUnwindSafe

impl<'a, C> Send for Database<'a, C> where
    C: Send

impl<'a, C> Sync for Database<'a, C> where
    C: Send

impl<'a, C> Unpin for Database<'a, C>

impl<'a, C> UnwindSafe for Database<'a, C> where
    C: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.