[−][src]Struct arangors::database::Database
Methods
impl<'a> Database<'a>
[src]
pub fn accessible_collections(&self) -> Result<Vec<CollectionResponse>, Error>
[src]
Retrieve all collections of this database.
pub fn get_url(&self) -> &Url
[src]
pub fn get_session(&self) -> Arc<Client>
[src]
pub fn collection(&self, name: &str) -> Result<Collection, Error>
[src]
Get collection object with name.
pub fn create_edge_collection(&self, _name: &str) -> Collection
[src]
pub fn create_collection(&mut self, name: &str) -> Result<Collection, Error>
[src]
Create a collection via HTTP request and add it into self.collections
.
Return a database object if success.
pub fn drop_collection(&self, name: &str) -> Result<(), Error>
[src]
Drops a collection
pub fn arango_version(&self) -> Result<Version, Error>
[src]
Get the version remote arango database server
Note
this function would make a request to arango server.
pub fn info(&self) -> Result<DatabaseInfo, Error>
[src]
pub fn aql_query_batch<R>(&self, aql: AqlQuery) -> Result<Cursor<R>, Error> where
R: DeserializeOwned + Debug,
[src]
R: DeserializeOwned + Debug,
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.
pub fn aql_next_batch<R>(&self, cursor_id: &str) -> Result<Cursor<R>, Error> where
R: DeserializeOwned + Debug,
[src]
R: DeserializeOwned + Debug,
Get next batch given the cursor id.
pub fn aql_query<R>(&self, aql: AqlQuery) -> Result<Vec<R>, Error> where
R: DeserializeOwned + Debug,
[src]
R: DeserializeOwned + Debug,
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.
pub fn aql_str<R>(&self, query: &str) -> Result<Vec<R>, Error> where
R: DeserializeOwned + Debug,
[src]
R: DeserializeOwned + Debug,
Similar to aql_query
, except that this method only accept a string of
AQL query.
pub fn aql_bind_vars<R>(
&self,
query: &str,
bind_vars: HashMap<&str, Value>
) -> Result<Vec<R>, Error> where
R: DeserializeOwned + Debug,
[src]
&self,
query: &str,
bind_vars: HashMap<&str, Value>
) -> Result<Vec<R>, Error> where
R: DeserializeOwned + Debug,
Similar to aql_query
, except that this method only accept a string of
AQL query, with additional bind vars.
Trait Implementations
Auto Trait Implementations
impl<'a> Sync for Database<'a>
impl<'a> Send for Database<'a>
impl<'a> Unpin for Database<'a>
impl<'a> !RefUnwindSafe for Database<'a>
impl<'a> !UnwindSafe for Database<'a>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,