Struct rsfbclient::builders::PureRustConnectionBuilder
source · pub struct PureRustConnectionBuilder(/* private fields */);
Expand description
A builder for a firebird client implemented in pure rust. Does not currently support embedded connections.
Use builder_pure_rust()
to obtain a new instance.
Implementations§
source§impl PureRustConnectionBuilder
impl PureRustConnectionBuilder
pub fn connect(&self) -> Result<Connection<RustFbClient>, FbError>
pub fn create_database(&self) -> Result<Connection<RustFbClient>, FbError>
sourcepub fn db_name<S: Into<String>>(&mut self, db_name: S) -> &mut Self
pub fn db_name<S: Into<String>>(&mut self, db_name: S) -> &mut Self
Database name or path. Default: test.fdb
sourcepub fn host<S: Into<String>>(&mut self, host: S) -> &mut Self
pub fn host<S: Into<String>>(&mut self, host: S) -> &mut Self
Hostname or IP address of the server. Default: localhost
sourcepub fn stmt_cache_size(&mut self, stmt_cache_size: usize) -> &mut Self
pub fn stmt_cache_size(&mut self, stmt_cache_size: usize) -> &mut Self
Statement cache size. Default: 20
sourcepub fn page_size(&mut self, size: u32) -> &mut Self
pub fn page_size(&mut self, size: u32) -> &mut Self
Database page size. Used on db creation. Default: depends on firebird version
sourcepub fn no_db_triggers(&mut self) -> &mut Self
pub fn no_db_triggers(&mut self) -> &mut Self
Disabled the database triggers
sourcepub fn transaction(&mut self, conf: TransactionConfiguration) -> &mut Self
pub fn transaction(&mut self, conf: TransactionConfiguration) -> &mut Self
Default transaction configuration
sourcepub fn with_transaction<F>(&mut self, builder: F) -> &mut Self
pub fn with_transaction<F>(&mut self, builder: F) -> &mut Self
Default transaction configuration builder
sourcepub fn from_string(&mut self, s_conn: &str) -> Result<&mut Self, FbError>
pub fn from_string(&mut self, s_conn: &str) -> Result<&mut Self, FbError>
Setup the connection using the string pattern.
You can use the others methods(host()
,user()
…) to config
some default values.
Basic string syntax: firebird://{user}:{pass}@{host}:{port}/{db_name}?charset={charset}&dialect={dialect}
Trait Implementations§
source§impl Clone for PureRustConnectionBuilder
impl Clone for PureRustConnectionBuilder
source§fn clone(&self) -> PureRustConnectionBuilder
fn clone(&self) -> PureRustConnectionBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for PureRustConnectionBuilder
impl Default for PureRustConnectionBuilder
source§impl FirebirdClientFactory for PureRustConnectionBuilder
impl FirebirdClientFactory for PureRustConnectionBuilder
type C = RustFbClient
source§fn get_conn_conf(
&self
) -> &ConnectionConfiguration<RustFbClientAttachmentConfig>
fn get_conn_conf( &self ) -> &ConnectionConfiguration<RustFbClientAttachmentConfig>
Pull the connection configuration details out as a borrow
source§impl From<&PureRustConnectionBuilder> for ConnectionConfiguration<RustFbClientAttachmentConfig>
impl From<&PureRustConnectionBuilder> for ConnectionConfiguration<RustFbClientAttachmentConfig>
source§fn from(arg: &PureRustConnectionBuilder) -> Self
fn from(arg: &PureRustConnectionBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for PureRustConnectionBuilder
impl Send for PureRustConnectionBuilder
impl Sync for PureRustConnectionBuilder
impl Unpin for PureRustConnectionBuilder
impl !UnwindSafe for PureRustConnectionBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more