1/*
2Copyright 2014 SAP SE
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17package driver
18
19// DSN parameters. For parameter client locale see http://help.sap.com/hana/SAP_HANA_SQL_Command_Network_Protocol_Reference_en.pdf.
20const (
21	DSNLocale    = "locale"    // Client locale as described in the protocol reference.
22	DSNTimeout   = "timeout"   // Driver side connection timeout in seconds.
23	DSNFetchSize = "fetchSize" // Maximum number of fetched records from database by database/sql/driver/Rows.Next().
24)
25
26/*
27DSN TLS parameters.
28For more information please see https://golang.org/pkg/crypto/tls/#Config.
29For more flexibility in TLS configuration please see driver.Connector.
30*/
31const (
32	DSNTLSRootCAFile         = "TLSRootCAFile"         // Path,- filename to root certificate(s).
33	DSNTLSServerName         = "TLSServerName"         // ServerName to verify the hostname.
34	DSNTLSInsecureSkipVerify = "TLSInsecureSkipVerify" // Controls whether a client verifies the server's certificate chain and host name.
35)
36
37// DSN default values.
38const (
39	DefaultTimeout   = 300 // Default value connection timeout (300 seconds = 5 minutes).
40	DefaultFetchSize = 128 // Default value fetchSize.
41)
42
43// DSN minimal values.
44const (
45	minTimeout   = 0 // Minimal timeout value.
46	minFetchSize = 1 // Minimal fetchSize value.
47)
48
49/*
50DSN is here for the purposes of documentation only. A DSN string is an URL string with the following format
51
52	"hdb://<username>:<password>@<host address>:<port number>"
53
54and optional query parameters (see DSN query parameters and DSN query default values).
55
56Example:
57	"hdb://myuser:mypassword@localhost:30015?timeout=60"
58
59Examples TLS connection:
60	"hdb://myuser:mypassword@localhost:39013?TLSRootCAFile=trust.pem"
61	"hdb://myuser:mypassword@localhost:39013?TLSRootCAFile=trust.pem&TLSServerName=hostname"
62	"hdb://myuser:mypassword@localhost:39013?TLSInsecureSkipVerify"
63*/
64type DSN string
65