Struct rsfbclient::NativeConnectionBuilder[][src]

pub struct NativeConnectionBuilder<LinkageType, ConnectionType> { /* fields omitted */ }

A builder for a client using the official (‘native’) Firebird dll.

Use the builder_native() method to get a new builder instance, and the provided configuration methods to change the default configuration params.

Note that one of with_remote()/with_embedded() and one of with_dyn_link()/with_dyn_load(...) must be called in order to enable creating a connection or calling other configuration methods.

Implementations

impl<A, B> NativeConnectionBuilder<A, B> where
    A: ConfiguredLinkage,
    B: ConfiguredConnType,
    A: LinkageMarker,
    Self: FirebirdClientFactory<C = NativeFbClient<A>>, 
[src]

pub fn connect(&self) -> Result<Connection<NativeFbClient<A>>, FbError>[src]

Create a new connection from the fully-built builder

impl<A, B> NativeConnectionBuilder<A, B> where
    A: ConfiguredLinkage,
    B: ConfiguredConnType, 
[src]

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

Username. Default: SYSDBA

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

Database name or path. Default: test.fdb

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

SQL Dialect. Default: 3

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

Connection charset. Default: UTF-8

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

Statement cache size. Default: 20

impl<A> NativeConnectionBuilder<A, ConnRemote>[src]

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

Hostname or IP address of the server. Default: localhost

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

TCP Port of the server. Default: 3050

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

Password. Default: masterkey

impl<A> NativeConnectionBuilder<A, ConnTypeNotConfigured>[src]

pub fn with_remote(self) -> NativeConnectionBuilder<A, ConnRemote>[src]

Configure the native client for remote connections. This will allow configuration via the ‘host’, ‘port’ and ‘pass’ methods.

pub fn with_embedded(self) -> NativeConnectionBuilder<A, ConnEmbedded>[src]

Configure the native client for embedded connections. There is no ‘host’, ‘port’ or ‘pass’ to configure on the result of this method and attempts to call those methods will result in a compile error.

Note that the embedded builder is only tested for firebird >=3.0. If the embedded connection fails, the client dll may attempt to use other means of connection automatically, such as XNET or localhost.

On firebird 3.0 and above this may be restricted via the Providers config parameter of firebird.conf see official firebird documentation for more information.

impl<A> NativeConnectionBuilder<LinkageNotConfigured, A>[src]

Uses the native client with dynamic linking. Requires that the dynamic library .dll/.so/.dylib can be found at compile time as well as runtime.

Requires feature linking

pub fn with_dyn_load<S: Into<String>>(
    self,
    lib_path: S
) -> NativeConnectionBuilder<DynLoad, A>
[src]

Searches for the firebird client at runtime only, at the specified location.

Example

// On windows
rsfbclient::builder_native()
  .with_dyn_load("fbclient.dll")
  .with_embedded();


// On linux
rsfbclient::builder_native()
  .with_dyn_load("libfbclient.so")
  .with_remote();

// Any platform, file located relative to the
// folder where the executable was run
rsfbclient::builder_native()
  .with_dyn_load("./fbclient.lib")
  .with_embedded();

Requires feature ‘dynamic_loading’.

pub fn from_string(
    self,
    s_conn: &str
) -> Result<NativeConnectionBuilder<DynByString, ConnByString>, FbError>
[src]

Setup the connection using the string pattern.

Basic string syntax: firebird://{user}:{pass}@{host}:{port}/{db_name}?charset={charset}&lib={fbclient}&dialect={dialect}

Some considerations:

  • If you not provide the host, we will consider this a embedded connection.
  • The port, user and pass parameters only will be accepted if you provide the host.
  • If you not provide the lib={fbclient}, we will consider this a dynamic linked connection. The default, by the way.

Trait Implementations

impl<LinkageType: Clone, ConnectionType: Clone> Clone for NativeConnectionBuilder<LinkageType, ConnectionType>[src]

impl Default for NativeConnectionBuilder<LinkageNotConfigured, ConnTypeNotConfigured>[src]

impl<A> FirebirdClientFactory for NativeConnectionBuilder<DynLoad, A> where
    A: ConfiguredConnType, 
[src]

type C = NativeFbClient<DynLoad>

impl<A> FirebirdClientFactory for NativeConnectionBuilder<DynLink, A> where
    A: ConfiguredConnType, 
[src]

type C = NativeFbClient<DynLink>

impl<A, B> From<&'_ NativeConnectionBuilder<A, B>> for ConnectionConfiguration<NativeFbAttachmentConfig>[src]

Auto Trait Implementations

impl<LinkageType, ConnectionType> !RefUnwindSafe for NativeConnectionBuilder<LinkageType, ConnectionType>

impl<LinkageType, ConnectionType> Send for NativeConnectionBuilder<LinkageType, ConnectionType> where
    ConnectionType: Send,
    LinkageType: Send

impl<LinkageType, ConnectionType> Sync for NativeConnectionBuilder<LinkageType, ConnectionType> where
    ConnectionType: Sync,
    LinkageType: Sync

impl<LinkageType, ConnectionType> Unpin for NativeConnectionBuilder<LinkageType, ConnectionType> where
    ConnectionType: Unpin,
    LinkageType: Unpin

impl<LinkageType, ConnectionType> !UnwindSafe for NativeConnectionBuilder<LinkageType, ConnectionType>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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