Struct tiberius::Config [−][src]
pub struct Config { /* fields omitted */ }
Expand description
The Config
struct contains all configuration information
required for connecting to the database with a Client
. It also provides
the server address when connecting to a TcpStream
via the
get_addr
method.
When using an ADO.NET connection string, it can be
constructed using the from_ado_string
function.
Implementations
A host or ip address to connect to.
- Defaults to
localhost
.
The database to connect to.
- Defaults to
master
.
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.
- Defaults to no name specified.
Sets the application name to the connection, queryable with the
APP_NAME()
command.
- Defaults to no name specified.
Set the preferred encryption level.
- With
tls
feature, defaults toRequired
. - Without
tls
feature, defaults toNotSupported
.
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.
- Defaults to
false
.
Sets the authentication method.
- Defaults to
None
.
Creates a new Config
from an ADO.NET connection string.
Supported parameters
All parameter keys are handled case-insensitive.
Parameter | Allowed values | Description |
---|---|---|
server | <string> | The 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 |
IntegratedSecurity | true ,false ,yes ,no | Toggle between Windows/Kerberos authentication and SQL authentication. |
uid ,username ,user ,user id | <string> | The SQL Server login account. |
password ,pwd | <string> | The password for the SQL Server account logging on. |
database | <string> | The name of the database. |
TrustServerCertificate | true ,false ,yes ,no | Specifies whether the driver trusts the server certificate when connecting using TLS. |
encrypt | true ,false ,yes ,no ,DANGER_PLAINTEXT | Specifies whether the driver uses TLS to encrypt communication. |
Application Name , ApplicationName | <string> | Sets the application name for the connection. |
Creates a new Config
from a JDBC connection string.
See from_ado_string
method for supported parameters.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more