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

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

Implementations

impl<'a, C: ClientExt> Database<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 url(&self) -> &Url[src]

pub fn name(&self) -> &str[src]

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

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

Get collection object with name.

Note

this function would make a request to arango server.

pub async fn create_collection_with_options<'f>(
    &self,
    options: CreateOptions<'f>,
    parameters: CreateParameters
) -> Result<Collection<C>, ClientError>
[src]

Create a collection via HTTP request with options.

Return a collection object if success.

Note

this function would make a request to arango server.

pub async fn create_collection(
    &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 create_edge_collection(
    &self,
    name: &str
) -> Result<Collection<C>, ClientError>
[src]

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

Drops a collection

Note

this function would make a request to arango server.

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
[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
[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
[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
[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
[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.

pub async fn create_index(
    &self,
    collection: &str,
    index: &Index
) -> Result<Index, ClientError>
[src]

Create a new index on a collection.

Note

this function would make a request to arango server.

pub async fn index(&self, id: &str) -> Result<Index, ClientError>[src]

Retrieve an index by id

Note

this function would make a request to arango server.

pub async fn indexes(
    &self,
    collection: &str
) -> Result<IndexCollection, ClientError>
[src]

Retrieve a list of indexes for a collection.

Note

this function would make a request to arango server.

pub async fn delete_index(
    &self,
    id: &str
) -> Result<DeleteIndexResponse, ClientError>
[src]

Delete an index by id.

Note

this function would make a request to arango server.

pub async fn create_graph(
    &self,
    graph: Graph,
    wait_for_sync: bool
) -> Result<Graph, ClientError>
[src]

Create a new graph in the graph module.

Arguments

  • graph - The graph object to create, its name must be unique.
  • wait_for_sync - define if the request should wait until everything is synced to disc.

Note

this function would make a request to arango server.

pub async fn graph(&self, name: &str) -> Result<Graph, ClientError>[src]

Retrieve an graph by name

Note

this function would make a request to arango server.

pub async fn graphs(&self) -> Result<GraphCollection, ClientError>[src]

Retrieve the list of created graphs.

Note

this function would make a request to arango server.

pub async fn drop_graph(
    &self,
    name: &str,
    drop_collections: bool
) -> Result<(), ClientError>
[src]

Drops an existing graph object by name. Optionally all collections not used by other graphs can be dropped as well.

Arguments

  • name - The name of the graph to drop
  • drop_collections- if set to true, drops collections of this graph as well. Collections will only be dropped if they are not used in other graphs.

Note

this function would make a request to arango server.

pub async fn list_transactions(
    &self
) -> Result<Vec<TransactionState>, ClientError>
[src]

Return the currently running server-side transactions

Note

this function would make a request to arango server.

pub async fn begin_transaction(
    &self,
    transaction_settings: TransactionSettings
) -> Result<Transaction<C>, ClientError>
[src]

Begin a server-side transaction, the transaction settings should specify at least collections to be updated through the write list

Note

this function would make a request to arango server.

pub async fn list_views(&self) -> Result<Vec<ViewDescription>, ClientError>[src]

Returns an object containing a listing of all Views in a database, regardless of their typ

Note

this function would make a request to arango server.

pub async fn create_view(
    &self,
    view_options: ViewOptions
) -> Result<View, ClientError>
[src]

Creates an ArangoSearch View

Note

this function would make a request to arango server.

pub async fn view(
    &self,
    view_name: &str
) -> Result<ViewDescription, ClientError>
[src]

Return information about a View

Note

this function would make a request to arango server.

pub async fn view_properties(
    &self,
    view_name: &str
) -> Result<ArangoSearchViewProperties, ClientError>
[src]

Read properties of a View

Note

this function would make a request to arango server.

pub async fn replace_view_properties(
    &self,
    view_name: &str,
    properties: ArangoSearchViewPropertiesOptions
) -> Result<View, ClientError>
[src]

Changes all the properties of an ArangoSearch

Note

this function would make a request to arango server.

pub async fn update_view_properties(
    &self,
    view_name: &str,
    properties: ArangoSearchViewPropertiesOptions
) -> Result<View, ClientError>
[src]

Partially changes properties of an ArangoSearch View

Note

this function would make a request to arango server.

pub async fn drop_view(&self, view_name: &str) -> Result<bool, ClientError>[src]

Drops the View identified by view-name.

Note

this function would make a request to arango server.

pub async fn list_analyzers(&self) -> Result<Vec<AnalyzerInfo>, ClientError>[src]

pub async fn create_analyzer(
    &self,
    analyzer: AnalyzerInfo
) -> Result<AnalyzerInfo, ClientError>
[src]

Create an Analyzer with the supplied definition

Note

this function would make a request to arango server.

pub async fn analyzer(
    &self,
    analyzer_name: &str
) -> Result<AnalyzerInfo, ClientError>
[src]

Return the Analyzer definition

Note

this function would make a request to arango server.

pub async fn drop_analyzer(
    &self,
    analyzer_name: &str
) -> Result<AnalyzerDescription, ClientError>
[src]

Removes an Analyzer configuration identified by analyzer_name.

Note

this function would make a request to arango server.

Trait Implementations

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

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

Auto Trait Implementations

impl<C> RefUnwindSafe for Database<C> where
    C: RefUnwindSafe

impl<C> Send for Database<C> where
    C: Send

impl<C> Sync for Database<C> where
    C: Send

impl<C> Unpin for Database<C>

impl<C> UnwindSafe for Database<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> Instrument for T[src]

impl<T> Instrument 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.