Struct hdbconnect::ConnectParams [−][src]
pub struct ConnectParams { /* fields omitted */ }
An immutable struct with all information necessary to open a new connection to a HANA database.
An instance of ConnectParams
can be created from a url (represented as String
or as Url
)
either using the trait IntoConnectParams
and its implementations, or with the shortcut
ConnectParams::from_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_trust_anchor_dir
: the<value>
points to a folder with pem files that contain the server's certificates; all pem files in that folder are evaluated
The client locale is used in language-dependent handling within the SAP HANA database calculation engine.
Example
use hdbconnect::IntoConnectParams; let conn_params = "hdbsql://my_user:my_passwd@the_host:2222" .into_connect_params() .unwrap();
Methods
impl ConnectParams
[src]
impl ConnectParams
pub fn builder() -> ConnectParamsBuilder
[src]
pub fn builder() -> ConnectParamsBuilder
Returns a new builder for ConnectParams.
pub fn from_file<P: AsRef<Path>>(path: P) -> HdbResult<ConnectParams>
[src]
pub fn from_file<P: AsRef<Path>>(path: P) -> HdbResult<ConnectParams>
Reads a url from the given file and converts it into ConnectParams
.
pub fn host(&self) -> &str
[src]
pub fn host(&self) -> &str
The host.
pub fn addr(&self) -> &str
[src]
pub fn addr(&self) -> &str
The socket address.
pub fn use_tls(&self) -> bool
[src]
pub fn use_tls(&self) -> bool
Whether TLS or a plain TCP connection is to be used.
pub fn dbuser(&self) -> &String
[src]
pub fn dbuser(&self) -> &String
The database user.
pub fn password(&self) -> &SecStr
[src]
pub fn password(&self) -> &SecStr
The password.
pub fn clientlocale(&self) -> &Option<String>
[src]
pub fn clientlocale(&self) -> &Option<String>
The client locale.
pub fn options(&self) -> &[(String, String)]
[src]
pub fn options(&self) -> &[(String, String)]
Options to be passed to HANA.
Trait Implementations
impl Clone for ConnectParams
[src]
impl Clone for ConnectParams
fn clone(&self) -> ConnectParams
[src]
fn clone(&self) -> ConnectParams
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for ConnectParams
[src]
impl Debug for ConnectParams
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl IntoConnectParams for ConnectParams
[src]
impl IntoConnectParams for ConnectParams
fn into_connect_params(self) -> HdbResult<ConnectParams>
[src]
fn into_connect_params(self) -> HdbResult<ConnectParams>
Converts the value of self
into a ConnectParams
.
Auto Trait Implementations
impl Send for ConnectParams
impl Send for ConnectParams
impl Sync for ConnectParams
impl Sync for ConnectParams