Versions in this module Expand all Collapse all v0 v0.0.2 Aug 1, 2025 Changes in this version + var ErrCheckViolation = errors.New("libdb: check constraint violation") + var ErrConstraintViolation = errors.New("libdb: constraint violation") + var ErrDataTruncation = errors.New("libdb: data truncation error") + var ErrDeadlockDetected = errors.New("libdb: deadlock detected") + var ErrForeignKeyViolation = errors.New("libdb: foreign key violation") + var ErrInvalidInputSyntax = errors.New("libdb: invalid input syntax") + var ErrLockNotAvailable = errors.New("libdb: lock not available") + var ErrMaxRowsReached = errors.New("max row count reached") + var ErrNotFound = errors.New("libdb: not found") + var ErrNotNullViolation = errors.New("libdb: not null constraint violation") + var ErrNumericOutOfRange = errors.New("libdb: numeric value out of range") + var ErrQueryCanceled = errors.New("libdb: query canceled") + var ErrSerializationFailure = errors.New("libdb: serialization failure") + var ErrTxFailed = errors.New("libdb: transaction failed") + var ErrUndefinedColumn = errors.New("libdb: undefined column") + var ErrUndefinedTable = errors.New("libdb: undefined table") + var ErrUniqueViolation = errors.New("libdb: unique constraint violation") + func SetupLocalInstance(ctx context.Context, dbName, dbUser, dbPassword string) (string, *postgres.PostgresContainer, func(), error) + type CommitTx func(ctx context.Context) error + type DBManager interface + Close func() error + WithTransaction func(ctx context.Context, onRollback ...func()) (Exec, CommitTx, ReleaseTx, error) + WithoutTransaction func() Exec + func NewPostgresDBManager(ctx context.Context, dsn string, schema string) (DBManager, error) + type Exec interface + ExecContext func(ctx context.Context, query string, args ...any) (sql.Result, error) + QueryContext func(ctx context.Context, query string, args ...any) (*sql.Rows, error) + QueryRowContext func(ctx context.Context, query string, args ...any) QueryRower + type QueryRower interface + Scan func(dest ...any) error + type ReleaseTx func() error