Skip to content

Commit 05173fa

Browse files
committed
SQL docs
1 parent 36db087 commit 05173fa

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

SQL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ func main() {
4545
if err != nil {
4646
// fallback on error
4747
}
48+
defer nativeDriver.Close(context.TODO())
4849
connector, err := ydb.Connector(nativeDriver,
4950
// See ydb.ConnectorOption's for configure connector https://pkg.go.dev/github.com/ydb-platform/ydb-go-sdk/v3#ConnectorOption
5051
)
5152
if err != nil {
5253
// fallback on error
5354
}
5455
db := sql.OpenDB(connector)
56+
defer db.Close()
5557
}
5658
```
5759

@@ -65,6 +67,7 @@ import (
6567

6668
func main() {
6769
db, err := sql.Open("ydb", "grpcs://localhost:2135/local")
70+
defer db.Close()
6871
}
6972
```
7073
Data source name parameters:

SQL_MIGRATION_v2_v3.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ Second way (making driver from connector) are different in `v2` and `v3`:
3030
if err != nil {
3131
// fallback on error
3232
}
33+
defer nativeDriver.Close(context.TODO())
3334
connector, err := ydb.Connector(nativeDriver)
3435
if err != nil {
3536
// fallback on error
3637
}
3738
db := sql.OpenDB(connector)
39+
defer db.Close()
3840
```
3941

4042
## Read-only isolation levels

0 commit comments

Comments
 (0)