pub trait FirebirdClientDbOps: Send {
type DbHandle: Send;
type AttachmentConfig: Send + Clone;
// Required methods
fn attach_database(
&mut self,
config: &Self::AttachmentConfig,
dialect: Dialect,
no_db_triggers: bool,
) -> Result<Self::DbHandle, FbError>;
fn detach_database(
&mut self,
db_handle: &mut Self::DbHandle,
) -> Result<(), FbError>;
fn drop_database(
&mut self,
db_handle: &mut Self::DbHandle,
) -> Result<(), FbError>;
fn create_database(
&mut self,
config: &Self::AttachmentConfig,
page_size: Option<u32>,
dialect: Dialect,
) -> Result<Self::DbHandle, FbError>;
}
Expand description
Responsible for database administration and attachment/detachment
Required Associated Types§
Sourcetype AttachmentConfig: Send + Clone
type AttachmentConfig: Send + Clone
Configuration details for attaching to the database. A user of an implementation of this trait can configure attachment details (database name, user name, etcetera) and then pass this configuration to the implementation via this type when a new attachment is requested
Required Methods§
Sourcefn attach_database(
&mut self,
config: &Self::AttachmentConfig,
dialect: Dialect,
no_db_triggers: bool,
) -> Result<Self::DbHandle, FbError>
fn attach_database( &mut self, config: &Self::AttachmentConfig, dialect: Dialect, no_db_triggers: bool, ) -> Result<Self::DbHandle, FbError>
Create a new attachment to a database with the provided configuration Returns a database handle on success
Sourcefn detach_database(
&mut self,
db_handle: &mut Self::DbHandle,
) -> Result<(), FbError>
fn detach_database( &mut self, db_handle: &mut Self::DbHandle, ) -> Result<(), FbError>
Disconnect from the database
Sourcefn drop_database(
&mut self,
db_handle: &mut Self::DbHandle,
) -> Result<(), FbError>
fn drop_database( &mut self, db_handle: &mut Self::DbHandle, ) -> Result<(), FbError>
Drop the database
Sourcefn create_database(
&mut self,
config: &Self::AttachmentConfig,
page_size: Option<u32>,
dialect: Dialect,
) -> Result<Self::DbHandle, FbError>
fn create_database( &mut self, config: &Self::AttachmentConfig, page_size: Option<u32>, dialect: Dialect, ) -> Result<Self::DbHandle, FbError>
Create the database and attach Returns a database handle on success