Trait pliantdb_core::connection::ServerConnection [−][src]
pub trait ServerConnection: Send + Sync { #[must_use] fn create_database_with_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
schema: SchemaName
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; #[must_use] fn delete_database<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; #[must_use] fn list_databases<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Database>, Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; #[must_use] fn list_available_schemas<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<SchemaName>, Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; #[must_use] fn create_database<'life0, 'life1, 'async_trait, DB: Schema>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where
DB: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, { ... } }
Functions for interacting with a multi-database PliantDb
instance.
Required methods
#[must_use]fn create_database_with_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
schema: SchemaName
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
#[must_use]
fn create_database_with_schema<'life0, 'life1, 'async_trait>(&'life0 self,
name: &'life1 str,
schema: SchemaName
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Creates a database named name
using the SchemaName
schema
.
Errors
Error::InvalidDatabaseName
:name
must begin with an alphanumeric character ([a-zA-Z0-9]
), and all remaining characters must be alphanumeric, a period (.
), or a hyphen (-
).- [
Error::DatabaseNameAlreadyTaken]:
name` was already used for a previous database name. Database names are case insensitive.
#[must_use]fn delete_database<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
#[must_use]
fn delete_database<'life0, 'life1, 'async_trait>(&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Deletes a database named name
.
Errors
Error::DatabaseNotFound
: databasename
does not exist.- [
Error::Io)
]: an error occurred while deleting files.
#[must_use]fn list_databases<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Database>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
#[must_use]
fn list_databases<'life0, 'async_trait>(&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Database>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Lists the databases on this server.
#[must_use]fn list_available_schemas<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<SchemaName>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
#[must_use]
fn list_available_schemas<'life0, 'async_trait>(&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<SchemaName>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Lists the SchemaName
s on this server.
Provided methods
#[must_use]fn create_database<'life0, 'life1, 'async_trait, DB: Schema>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
DB: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
#[must_use]
fn create_database<'life0, 'life1, 'async_trait, DB: Schema>(&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
DB: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Creates a database named name
with the Schema
provided.
Errors
Error::InvalidDatabaseName
:name
must begin with an alphanumeric character ([a-zA-Z0-9]
), and all remaining characters must be alphanumeric, a period (.
), or a hyphen (-
).- [
Error::DatabaseNameAlreadyTaken]:
name` was already used for a previous database name. Database names are case insensitive.