Struct rincon_session::DatabaseSession
[−]
[src]
pub struct DatabaseSession<C> { /* fields omitted */ }
A session for operating with a specific database.
Methods
impl<C> DatabaseSession<C> where
C: 'static + Connector,
[src]
C: 'static + Connector,
pub fn execute<M>(&self, method: M) -> Result<<M as Method>::Result> where
M: 'static + Method + Prepare,
[src]
M: 'static + Method + Prepare,
Executes an API method applied to the database of this session.
pub fn name(&self) -> &str
[src]
Returns the name of the database this DatabaseSession
operates with.
pub fn unwrap(self) -> String
[src]
Unwraps the database name out of this session.
pub fn drop(self) -> Result<bool>
[src]
Drops the database that is used in this session.
Returns true if the database has been dropped successfully.
After calling this function the associated DatabaseSession
is no
longer valid.
pub fn query<T>(&self, query: Query) -> Result<CursorSession<T, C>> where
T: 'static + DeserializeOwned,
[src]
T: 'static + DeserializeOwned,
Executes a query and returns a cursor with the first result set.
All cursor options and query execution options are left to their default settings.
To specify cursor options and/or query execution options use the
query_opt(&self, NewCursor)
function.
pub fn query_opt<T>(&self, new_cursor: NewCursor) -> Result<CursorSession<T, C>> where
T: 'static + DeserializeOwned,
[src]
T: 'static + DeserializeOwned,
Executes a query and returns a cursor with the first result set.
It requires a NewCursor
struct as a parameter which allows full
control over all supported cursor options and query execution options.
To execute a query with all options left at their defaults the
query(&self, Query)
function might be more suitable.
pub fn explain_query(&self, query: Query) -> Result<ExplainedQuery>
[src]
Generates an execution plan for a query but does not execute it.
pub fn explain_query_opt(
&self,
query: Query,
options: ExplainOptions
) -> Result<ExplainedQuery>
[src]
&self,
query: Query,
options: ExplainOptions
) -> Result<ExplainedQuery>
Generates an execution plan for a query but does not execute it.
Some options about how many execution plans are generated and the configuration options for the query optimizer can be provided.
pub fn parse_query<Q>(&self, query: Q) -> Result<ParsedQuery> where
Q: Into<String>,
[src]
Q: Into<String>,
Parses a query a validates the syntax but does not execute it.
If the query can be parsed without error the abstract syntax tree (AST) of the query is returned.
pub fn get_document<T>(&self, id: DocumentId) -> Result<Document<T>> where
T: 'static + DeserializeOwned,
[src]
T: 'static + DeserializeOwned,
Fetch the document with the given id from the database of this session.
pub fn use_collection_with_name<N>(
&self,
collection_name: N
) -> CollectionSession<C> where
N: Into<String>,
[src]
&self,
collection_name: N
) -> CollectionSession<C> where
N: Into<String>,
Returns a new CollectionSession
for the collection with the given
name.
pub fn use_collection(&self, collection: Collection) -> CollectionSession<C>
[src]
Returns a new CollectionSession
for the given collection.
pub fn create_collection<N>(
&self,
collection_name: N
) -> Result<CollectionSession<C>> where
N: Into<String>,
[src]
&self,
collection_name: N
) -> Result<CollectionSession<C>> where
N: Into<String>,
Creates a new collection within the database of this session.
pub fn drop_collection<N>(&self, collection_name: N) -> Result<String> where
N: Into<String>,
[src]
N: Into<String>,
Drops the collection with the given name from the database of this session and returns the identifier of the dropped collection.
pub fn list_collections(&self) -> Result<Vec<Collection>>
[src]
Fetches a list of all collections in this database.
System collections are not included in the returned list.
pub fn list_collections_including_system(&self) -> Result<Vec<Collection>>
[src]
Fetches a list of all collections in this database including system collections.
pub fn use_graph_with_name<N>(&self, graph_name: N) -> GraphSession<C> where
N: Into<String>,
[src]
N: Into<String>,
Returns a new GraphSession
for the graph with the given name.
pub fn use_graph(&self, graph: Graph) -> GraphSession<C>
[src]
Returns a new GraphSession
for the given graph.
pub fn create_graph(&self, new_graph: NewGraph) -> Result<GraphSession<C>>
[src]
Creates a new graph in the database represented by this
DatabaseSession
.
pub fn drop_graph<N>(&self, graph_name: N) -> Result<bool> where
N: Into<String>,
[src]
N: Into<String>,
Drops the graph with the given name from the database of this session.
This function returns true if the graph has been deleted and false otherwise.
pub fn list_graphs(&self) -> Result<Vec<Graph>>
[src]
Fetches a list of all graphs in this database.