[][src]Struct tiberius::ClientBuilder

pub struct ClientBuilder { /* fields omitted */ }

A builder for creating a new Client.

Implementations

impl ClientBuilder[src]

pub fn host(&mut self, host: impl ToString)[src]

A host or ip address to connect to.

  • Defaults to localhost.

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

The server port.

  • Defaults to 1433.

pub fn database(&mut self, database: impl ToString)[src]

The database to connect to.

  • Defaults to master.

pub fn instance_name(&mut self, name: impl ToString)[src]

The instance name as defined in the SQL Browser. Only available on Windows platforms.

If specified, the port is replaced with the value returned from the browser.

pub fn encryption(&mut self, encryption: EncryptionLevel)[src]

Set the preferred encryption level.

pub fn trust_cert(&mut self)[src]

If set, the server certificate will not be validated and it is accepted as-is.

On production setting, the certificate should be added to the local key storage, using this setting is potentially dangerous.

pub fn authentication(&mut self, auth: AuthMethod)[src]

Sets the authentication method.

pub async fn build(self) -> Result<Client>[src]

Creates a new client and connects to the server.

pub fn from_ado_string(s: &str) -> Result<Self>[src]

Creates a new ClientBuilder from an ADO.NET connection string.

Supported parameters

ParametersDescription
serverThe name or network address of the instance of SQL Server to which to connect. The port number can be specified after the server name. The correct form of this parameter is either tcp:host,port or tcp:host\\instance
IntegratedSecurityToggle between Windows authentication and SQL authentication.
uid, username, userThe SQL Server login account.
password, pwdThe password for the SQL Server account logging on.
databaseThe name of the database.
TrustServerCertificateSpecifies whether the driver trusts the server certificate when connecting using TLS.
encryptSpecifies whether the driver uses TLS to encrypt communication.

Trait Implementations

impl Clone for ClientBuilder[src]

impl Default for ClientBuilder[src]

Auto Trait Implementations

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> 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>,