PureRustConnectionBuilder

Struct 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

Source

pub fn connect(&self) -> Result<Connection<RustFbClient>, FbError>

Source

pub fn create_database(&self) -> Result<Connection<RustFbClient>, FbError>

Source

pub fn user<S: Into<String>>(&mut self, user: S) -> &mut Self

Username. Default: SYSDBA

Source

pub fn db_name<S: Into<String>>(&mut self, db_name: S) -> &mut Self

Database name or path. Default: test.fdb

Source

pub fn host<S: Into<String>>(&mut self, host: S) -> &mut Self

Hostname or IP address of the server. Default: localhost

Source

pub fn port(&mut self, port: u16) -> &mut Self

TCP Port of the server. Default: 3050

Source

pub fn pass<S: Into<String>>(&mut self, pass: S) -> &mut Self

Password. Default: masterkey

Source

pub fn dialect(&mut self, dialect: Dialect) -> &mut Self

SQL Dialect. Default: 3

Source

pub fn stmt_cache_size(&mut self, stmt_cache_size: usize) -> &mut Self

Statement cache size. Default: 20

Source

pub fn charset(&mut self, charset: Charset) -> &mut Self

Connection charset. Default: UTF-8

Source

pub fn page_size(&mut self, size: u32) -> &mut Self

Database page size. Used on db creation. Default: depends on firebird version

Source

pub fn role<S: Into<String>>(&mut self, name: S) -> &mut Self

User role name. Default: empty

Source

pub fn no_db_triggers(&mut self) -> &mut Self

Disabled the database triggers

Source

pub fn transaction(&mut self, conf: TransactionConfiguration) -> &mut Self

Default transaction configuration

Source

pub fn with_transaction<F>(&mut self, builder: F) -> &mut Self

Default transaction configuration builder

Source

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

Source§

fn clone(&self) -> PureRustConnectionBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for PureRustConnectionBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl FirebirdClientFactory for PureRustConnectionBuilder

Source§

type C = RustFbClient

Source§

fn new_instance(&self) -> Result<Self::C, FbError>

Construct a new instance of a client
Source§

fn get_conn_conf( &self, ) -> &ConnectionConfiguration<RustFbClientAttachmentConfig>

Pull the connection configuration details out as a borrow
Source§

impl From<&PureRustConnectionBuilder> for ConnectionConfiguration<RustFbClientAttachmentConfig>

Source§

fn from(arg: &PureRustConnectionBuilder) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,