Versions in this module Expand all Collapse all v1 v1.1.0 Nov 6, 2026 v1.0.0 Nov 6, 2026 Changes in this version + func Classify(err error) error + type Client struct + func New(ctx context.Context, c Config) (*Client, error) + func (c *Client) Batch(ctx context.Context, ops []Operation) ([]sql.Result, error) + func (c *Client) BeginTx(ctx context.Context, o TxOptions) (*Tx, error) + func (c *Client) Close() error + func (c *Client) Exec(ctx context.Context, q string, a ...any) (sql.Result, error) + func (c *Client) Get(ctx context.Context, dst any, q string, a ...any) error + func (c *Client) Native() *sql.DB + func (c *Client) Ping(ctx context.Context) error + func (c *Client) Prepare(ctx context.Context, q string) (*Statement, error) + func (c *Client) Query(ctx context.Context, q string, a ...any) (db.Rows, error) + func (c *Client) QueryRow(ctx context.Context, q string, a ...any) db.Row + func (c *Client) Select(ctx context.Context, dst any, q string, a ...any) error + func (c *Client) Stats() sql.DBStats + func (c *Client) WithinTx(ctx context.Context, o TxOptions, fn func(*Tx) error) (err error) + type Cluster struct + func NewCluster(ctx context.Context, cfg ClusterConfig) (*Cluster, error) + func (c *Cluster) Close() error + func (c *Cluster) Reader(consistency Consistency) (*Client, error) + func (c *Cluster) Writer() *Client + type ClusterConfig struct + Primary Config + Replicas []Config + type Config struct + AllowPlaintext bool + ConnectTimeout time.Duration + DSN string + Hooks db.Hooks + MaxIdleConnections int + MaxIdleTime time.Duration + MaxLifetime time.Duration + MaxOpenConnections int + Observer instrument.Hook + QueryLogger *slog.Logger + QueryTimeout time.Duration + TLS *tls.Config + type Consistency int + const Eventual + const Strong + type Operation struct + Args []any + SQL string + type Statement struct + func (s *Statement) Close() error + func (s *Statement) Exec(ctx context.Context, args ...any) (sql.Result, error) + func (s *Statement) Get(ctx context.Context, dest any, args ...any) error + func (s *Statement) Native() *sql.Stmt + func (s *Statement) Query(ctx context.Context, args ...any) (db.Rows, error) + func (s *Statement) QueryRow(ctx context.Context, args ...any) db.Row + func (s *Statement) Select(ctx context.Context, dest any, args ...any) error + type Tx struct + func (t *Tx) Commit() error + func (t *Tx) CommitContext(ctx context.Context) error + func (t *Tx) Exec(ctx context.Context, q string, a ...any) (sql.Result, error) + func (t *Tx) Get(ctx context.Context, d any, q string, a ...any) error + func (t *Tx) Native() *sql.Tx + func (t *Tx) Query(ctx context.Context, q string, a ...any) (db.Rows, error) + func (t *Tx) QueryRow(ctx context.Context, q string, a ...any) db.Row + func (t *Tx) Rollback() error + func (t *Tx) RollbackContext(ctx context.Context) error + func (t *Tx) Select(ctx context.Context, d any, q string, a ...any) error + type TxOptions struct + Isolation sql.IsolationLevel + ReadOnly bool