Module hdbconnect::url
source · Expand description
Constants for use in connection URLs.
Database connections are initialized with an instance of ConnectParams
.
Instances of ConnectParams
can be created using a ConnectParamsBuilder
, or from a URL.
(Also ConnectParamsBuilder
s can be created from a URL.)
Such a URL is supposed to have the form
<scheme>://<username>:<password>@<host>:<port>[<options>]
where
<scheme>
=hdbsql
|hdbsqls
// for TCP or TLS connections, respectively
<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>]}]
Supported options are:
db=<databasename>
specifies the (MDC) database to which you want to connectclient_locale=<value>
is used in language-dependent handling within the SAP HANA database calculation engineclient_locale_from_env
(no value) lets the driver read the client’s locale from the environment variabe LANG<networkgroup>
= a network groupno_compression
disables the support for compression- the TLS options:
tls_certificate_dir=<value>
points to a folder with pem files that contain certificates; all pem files in that folder are evaluatedtls_certificate_env=<value>
denotes an environment variable that contains certificatesuse_mozillas_root_certificates
(no value) lets the driver use the root certificates fromhttps://mkcert.org/
insecure_omit_server_certificate_check
(no value) lets the driver omit the validation of the server’s identity. Don’t use this option in productive setups!
To configure TLS, use the scheme hdbsqls
and at least one of the TLS options.
For a plain connection without TLS, use the scheme hdbsql
and none of the TLS options.
§Examples
ConnectParams
is immutable, the URL must contain all necessary information:
use hdbconnect::IntoConnectParams;
let conn_params = "hdbsql://my_user:my_passwd@the_host:2222"
.into_connect_params()
.unwrap();
ConnectParamsBuilder
allows modifications before being converted into a ConnectParams
:
use hdbconnect::ConnectParamsBuilder;
let conn_params = ConnectParamsBuilder::from("hdbsql://my_user@the_host:2222")
.unwrap()
.with_password("no-secrets-in-urls")
.build()
.unwrap();
Constants§
- Option-key for denoting the client locale.
- Option-key for denoting an environment variable which contains the client locale.
- Option-key for denoting the (MDC) database to which you want to connect; when using this option,
<host>
and<port>
must specify the system database - Protocol without TLS
- Protocol with TLS
- Option-key for defining that the server’s identity is not validated. Don’t use this option in productive setups!
- Option-key for denoting a network group.
- Option-key for switching off compression
- Option-key for denoting a folder in which server certificates can be found.
- Option-key for denoting an environment variable in which a server certificate can be found
- option-key for defining that the server roots from https://mkcert.org/ should be added to the trust store for TLS.