You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5.[Retry helpers for `YDB``database/sql` driver](#retry)
15
16
*[Over `sql.Conn` object](#retry-conn)
16
17
*[Over `sql.Tx`](#retry-tx)
17
-
5.[Query args types](#arg-types)
18
-
6.[Get native driver from `*sql.DB`](#unwrap)
18
+
6.[Query args types](#arg-types)
19
+
7.[Get native driver from `*sql.DB`](#unwrap)
19
20
20
21
## Initialization of `database/sql` driver <aname="init"></a>
21
22
@@ -57,6 +58,17 @@ Data source name parameters:
57
58
* static credentials with authority part of URI, like `grpcs://root:password@localhost:2135/local`
58
59
*`query_mode=scripting` - you can redefine default [DML](https://en.wikipedia.org/wiki/Data_manipulation_language) query mode
59
60
61
+
## About session pool <aname="session-pool"></a>
62
+
63
+
Native driver `ydb-go-sdk/v3` implements internal session pool, which uses with `db.Table().Do()` or `db.Table().DoTx()` methods.
64
+
Internal session pool configures with options like `ydb.WithSessionPoolSizeLimit()` and other.
65
+
Unlike session pool in native driver, `database/sql` contains another session pool, which configures with `*sql.DB.SetMaxOpenConns` and `*sql.DB.SetMaxIdleConns`.
66
+
Lifetime of `YDB` session depends on driver configuration and predefined errors, such as `sql.driver.ErrBadConn`.
67
+
`YDB` driver for `database/sql` transform internal `YDB` errors into `sql.driver.ErrBadConn` depending on result of internal error check (delete session on error or not and other).
68
+
In most cases this behaviour of `database/sql` driver implementation for specific RDBMS completes queries without result errors.
69
+
But some errors on unfortunate cases may be get on client-side.
70
+
That's why querying must be wrapped with retry helpers, such as `retry.Do` or `retry.DoTx` (see more about retry helpers in [retry section](#retry)).
0 commit comments