@@ -26,20 +26,16 @@ import (
2626
2727// CreateClient returns a new client. The client connects lazily. Call
2828// Client.EnsureConnected() to force a connection.
29- func CreateClient (ctx context. Context , opts gelcfg.Options ) (* Client , error ) { // nolint:gocritic,lll
30- return CreateClientDSN (ctx , "" , opts )
29+ func CreateClient (opts gelcfg.Options ) (* Client , error ) { // nolint:gocritic,lll
30+ return CreateClientDSN ("" , opts )
3131}
3232
3333// CreateClientDSN returns a new client. See also CreateClient.
3434//
35- // dsn is either an instance name
36- // https://www.edgedb.com/docs/clients/connection
37- // or it specifies a single string in the following format:
35+ // dsn is either an instance name or a [DSN].
3836//
39- // gel://user:password@host:port/database?option=value.
40- //
41- // The following options are recognized: host, port, user, database, password.
42- func CreateClientDSN (_ context.Context , dsn string , opts gelcfg.Options ) (* Client , error ) { // nolint:gocritic,lll
37+ // [DSN]: https://docs.geldata.com/reference/reference/dsn#ref-dsn
38+ func CreateClientDSN (dsn string , opts gelcfg.Options ) (* Client , error ) { // nolint:gocritic,lll
4339 pool , err := gel .NewPool (dsn , opts )
4440 if err != nil {
4541 return nil , err
@@ -71,7 +67,7 @@ func (c *Client) EnsureConnected(ctx context.Context) error {
7167}
7268
7369// Close closes all connections in the client.
74- // Calling close blocks until all acquired connections have been released,
70+ // Calling Close() blocks until all acquired connections have been released,
7571// and returns an error if called more than once.
7672func (c * Client ) Close () error { return c .pool .Close () }
7773
@@ -270,19 +266,11 @@ func (c *Client) ExecuteSQL(
270266 return gel .FirstError (err , c .pool .Release (conn , err ))
271267}
272268
273- // Tx runs a [geltypes.TxBlock] in a transaction retrying failed attempts.
269+ // Tx runs action in a transaction retrying failed attempts.
274270//
275- // Retries are governed by retry rules.
276- // The default rule can be set with WithRetryRule().
277- // For more fine grained control a retry rule can be set
278- // for each defined RetryCondition using WithRetryCondition().
279- // When a transaction fails but is retryable
280- // the rule for the failure condition is used to determine if the transaction
281- // should be tried again based on RetryRule.Attempts and the amount of time
282- // to wait before retrying is determined by RetryRule.Backoff.
283- // If either field is unset (see RetryRule) then the default rule is used.
284- // If the object's default is unset the fall back is 3 attempts
285- // and exponential backoff.
271+ // Retries are governed by [gelcfg.RetryOptions] and [gelcfg.RetryRule].
272+ // retry options can be set using [Client.WithRetryOptions].
273+ // See [gelcfg.RetryRule] for more details on how they work.
286274func (c * Client ) Tx (ctx context.Context , action geltypes.TxBlock ) error {
287275 conn , err := c .pool .Acquire (ctx )
288276 if err != nil {
0 commit comments