package
0.0.0-20250213232608-c453f8b35c75
Repository: https://github.com/stellar/go.git
Documentation: pkg.go.dev

# Packages

Package sqlutils contains utility functions for manipulating strings of SQL.

# Functions

ColumnsForStruct returns a slice of column names for the provided value (which should be a struct, a slice of structs).
Open the database at `dsn` and returns a new *Session using it.
Wrap wraps a bare *sql.DB (from the database/sql stdlib package) in a *db.Session instance.

# Constants

PostgresQueryMaxParams defines the maximum number of parameters in a query.

# Variables

ErrAlreadyRolledback is an error returned by Session methods when the transaction containing the request has already been rolled back.
ErrBadConnection is an error returned when driver returns `bad connection` error.
ErrCancelled is an error returned by Session methods when request has been canceled (ex.
ErrConflictWithRecovery is an error returned by Session methods when read replica cancels the query due to conflict with about-to-be-applied WAL entries (https://www.postgresql.org/docs/current/hot-standby.html).
ErrNoTx is returned when Exec() is called outside of a transaction.
ErrSealed is returned when trying to add rows to the FastBatchInsertBuilder after Exec() is called.
ErrStatementTimeout is an error returned by Session methods when request has been canceled due to a statement timeout.
ErrTimeout is an error returned by Session methods when request has taken longer than context's deadline max duration.

# Structs

BatchInsertBuilder works like sq.InsertBuilder but has a better support for batching large number of rows.
DeleteBuilder is a helper struct used to construct sql queries of the DELETE variety.
FastBatchInsertBuilder works like sq.InsertBuilder but has a better support for batching large number of rows.
GetBuilder is a helper struct used to construct sql queries of the SELECT variety.
InsertBuilder is a helper struct used to construct sql queries of the INSERT variety.
NoRowsError is returned when an insert is attempted without providing any values to insert.
SelectBuilder is a helper struct used to construct sql queries of the SELECT variety.
Session provides helper methods for making queries against `DB` and provides utilities such as automatic query logging and transaction management.
Table helps to build sql queries against a given table.
UpdateBuilder is a helper struct used to construct sql queries of the UPDATE variety.

# Interfaces

Conn represents a connection to a single database.

# Type aliases

dbErr - the Postgres error ctx - the caller's context.