forked from influxdata/influxdb-iox-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc.go
More file actions
35 lines (35 loc) · 1.08 KB
/
doc.go
File metadata and controls
35 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Package ioxsql is the compatibility layer from influxdbiox to database/sql.
//
// A database/sql connection can be established through sql.Open.
// Two data source name formats are supported.
//
// The complete influxdbiox.ClientConfig struct is supported as JSON:
//
// dsn := `{
// "address": "localhost:8082",
// "tls_cert": "...",
// "tls_key": "..."
// }`
// db, err := sql.Open("influxdb-iox", dsn)
//
// The influxdbiox.ClientConfig struct serializes to JSON with method ToJSONString:
//
// config := &influxdbiox.ClientConfig{
// Address: "localhost:8082",
// TLSInsecureSkipVerify: true,
// }
// dsn, err = config.ToJSONString()
// db, err := sql.Open("influxdb-iox", dsn)
//
// The host:port address format is simpler to type, but only sets the address field:
//
// db, err := sql.Open("influxdb-iox", "localhost:8082")
//
// Or a influxdbiox.ClientConfig can be used directly.
//
// config := &influxdbiox.ClientConfig{
// Address: "localhost:8082",
// TLSInsecureSkipVerify: true,
// }
// db := sql.OpenDB(ioxsql.NewConnector(config))
package ioxsql