[−][src]Struct hdbconnect::ConnectParams
An immutable struct with all information necessary to open a new connection to a HANA database.
An instance of ConnectParams
can be created in various ways:
- using the builder
- using an implementation of
IntoConnectParams
- implementations are provided for URLs that are represented as
String
or asUrl
- implementations are provided for URLs that are represented as
- the shortcut
ConnectParams::from_file
reads the URL from a file
The URL is supposed to have the form
<scheme>://<username>:<password>@<host>:<port>[<options>]
where
<scheme>
=hdbsql
|hdbsqls
<username>
= the name of the DB user to log on
<password>
= the password of the DB user
<host>
= the host where HANA can be found
<port>
= the port at which HANA can be found on<host>
<options>
=?<key> = <value> [{&<key> = <value>}]
Special option keys are:
client_locale
:<value>
is used to specify the client's locale
client_locale_from_env
: if<value>
is 1, the client's locale is read from the environment variabe LANG
tls_certificate_dir
: the<value>
points to a folder with pem files that contain the server's certificates; all pem files in that folder are evaluated
tls_certificate_env
: the<value>
denotes the environment variable that contains the server's certificate
The client locale is used in language-dependent handling within the SAP HANA database calculation engine.
If you want to provide the server certificate directly, then
Example
use hdbconnect::IntoConnectParams; let conn_params = "hdbsql://my_user:my_passwd@the_host:2222" .into_connect_params() .unwrap();
Methods
impl ConnectParams
[src]
pub fn builder() -> ConnectParamsBuilder
[src]
Returns a new builder for ConnectParams.
pub fn from_file<P: AsRef<Path>>(path: P) -> HdbResult<ConnectParams>
[src]
Reads a url from the given file and converts it into ConnectParams
.
pub fn server_certs(&self) -> Option<&ServerCerts>
[src]
The ServerCerts.
pub fn host(&self) -> &str
[src]
The host.
pub fn addr(&self) -> &str
[src]
The socket address.
pub fn use_tls(&self) -> bool
[src]
Whether TLS or a plain TCP connection is to be used.
pub fn dbuser(&self) -> &String
[src]
The database user.
pub fn password(&self) -> &SecStr
[src]
The password.
pub fn clientlocale(&self) -> &Option<String>
[src]
The client locale.
Trait Implementations
impl IntoConnectParams for ConnectParams
[src]
fn into_connect_params(self) -> HdbResult<ConnectParams>
[src]
impl Clone for ConnectParams
[src]
fn clone(&self) -> ConnectParams
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for ConnectParams
[src]
Auto Trait Implementations
impl Send for ConnectParams
impl Sync for ConnectParams
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self