Struct hdbconnect_impl::ConnectParamsBuilder
source · pub struct ConnectParamsBuilder { /* private fields */ }Expand description
A builder for ConnectParams.
Instantiating a ConnectParamsBuilder programmatically
use hdbconnect::ConnectParams;
let connect_params = ConnectParams::builder()
.hostname("abcd123")
.port(2222)
.dbuser("MEIER")
.password("schlau")
.build()
.unwrap();Instantiating a ConnectParamsBuilder from a URL
See module url for details about the supported URLs.
use hdbconnect::IntoConnectParamsBuilder;
let conn_params = "hdbsql://abcd123:2222"
.into_connect_params_builder()
.unwrap()
.dbuser("MEIER")
.password("schlau")
.build()
.unwrap();Implementations§
source§impl ConnectParamsBuilder
impl ConnectParamsBuilder
sourcepub fn unset_password(&mut self) -> &mut Self
pub fn unset_password(&mut self) -> &mut Self
Unsets the password.
sourcepub fn dbname<D: AsRef<str>>(&mut self, dbname: D) -> &mut Self
pub fn dbname<D: AsRef<str>>(&mut self, dbname: D) -> &mut Self
Sets the database name.
This allows specifying host and port of the system DB and getting automatically redirected and connected to the specified tenant database.
sourcepub fn network_group<D: AsRef<str>>(&mut self, network_group: D) -> &mut Self
pub fn network_group<D: AsRef<str>>(&mut self, network_group: D) -> &mut Self
Sets the network group.
sourcepub fn clientlocale<P: AsRef<str>>(&mut self, cl: P) -> &mut Self
pub fn clientlocale<P: AsRef<str>>(&mut self, cl: P) -> &mut Self
Sets the client locale.
sourcepub fn clientlocale_from_env_lang(&mut self) -> &mut Self
pub fn clientlocale_from_env_lang(&mut self) -> &mut Self
Sets the client locale from the value of the environment variable LANG
sourcepub fn always_uncompressed(&mut self, uncompressed: bool) -> &mut Self
pub fn always_uncompressed(&mut self, uncompressed: bool) -> &mut Self
Switch off compression (for debugging purposes?)
By default, compression is supported, like with always_uncompressed(false)
sourcepub fn tls_with(&mut self, server_certs: ServerCerts) -> &mut Self
pub fn tls_with(&mut self, server_certs: ServerCerts) -> &mut Self
Makes the driver use TLS for the connection to the database.
Requires that the server’s certificate is provided with one of the
enum variants of ServerCerts.
If needed, you can call this function multiple times with different ServerCert variants.
Example:
let mut conn_params = ConnectParams::builder()
// ...more settings required...
.tls_with(ServerCerts::Direct(string_with_certificate))
.build();sourcepub fn tls_without_server_verification(&mut self) -> &mut Self
pub fn tls_without_server_verification(&mut self) -> &mut Self
Makes the driver use TLS for the connection to the database, but hazardously without verifying the server’s certificate. Erases all already configured server certs.
sourcepub fn build(&self) -> HdbResult<ConnectParams>
pub fn build(&self) -> HdbResult<ConnectParams>
Constructs a ConnectParams from the builder.
Errors
HdbError::Usage if the builder was not yet configured to
create a meaningful ConnectParams
Trait Implementations§
source§impl Clone for ConnectParamsBuilder
impl Clone for ConnectParamsBuilder
source§fn clone(&self) -> ConnectParamsBuilder
fn clone(&self) -> ConnectParamsBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ConnectParamsBuilder
impl Debug for ConnectParamsBuilder
source§impl Default for ConnectParamsBuilder
impl Default for ConnectParamsBuilder
source§fn default() -> ConnectParamsBuilder
fn default() -> ConnectParamsBuilder
source§impl<'de> Deserialize<'de> for ConnectParamsBuilder
impl<'de> Deserialize<'de> for ConnectParamsBuilder
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl Display for ConnectParamsBuilder
impl Display for ConnectParamsBuilder
source§impl From<ConnectParamsBuilder> for String
impl From<ConnectParamsBuilder> for String
source§fn from(cpb: ConnectParamsBuilder) -> String
fn from(cpb: ConnectParamsBuilder) -> String
source§impl IntoConnectParams for &ConnectParamsBuilder
impl IntoConnectParams for &ConnectParamsBuilder
source§fn into_connect_params(self) -> HdbResult<ConnectParams>
fn into_connect_params(self) -> HdbResult<ConnectParams>
source§impl IntoConnectParams for ConnectParamsBuilder
impl IntoConnectParams for ConnectParamsBuilder
source§fn into_connect_params(self) -> HdbResult<ConnectParams>
fn into_connect_params(self) -> HdbResult<ConnectParams>
source§impl IntoConnectParamsBuilder for ConnectParamsBuilder
impl IntoConnectParamsBuilder for ConnectParamsBuilder
source§impl PartialEq for ConnectParamsBuilder
impl PartialEq for ConnectParamsBuilder
source§fn eq(&self, other: &ConnectParamsBuilder) -> bool
fn eq(&self, other: &ConnectParamsBuilder) -> bool
self and other values to be equal, and is used
by ==.