Versions in this module Expand all Collapse all v0 v0.2.0 Dec 10, 2025 v0.1.0 Dec 10, 2025 Changes in this version + const ModuleName + var ErrNoDBConnection error = fmt.Errorf("database connection pool not set") + var ErrNoTransaction error = fmt.Errorf("transaction has not been started") + var ErrNotFound error = fmt.Errorf("resource not found") + func BuildDSN(user, password, host, database string, port uint, queryOpts ...string) *url.URL + func New() modules.Module + func WithDSN(dsn string) modules.Option + func WithDatabase(database string) modules.Option + func WithHost(host string) modules.Option + func WithMigrations(cfg *MigrationsConfig) modules.Option + func WithMigrationsLocation(location string) modules.Option + func WithMigrationsSchemaName(schemaName string) modules.Option + func WithMigrationsTable(table string) modules.Option + func WithPassword(password string) modules.Option + func WithPort(port uint) modules.Option + func WithUser(user string) modules.Option + type CloseTx func(error) error + type ExecOption func(*Executor) + func WithFilter(filter query.Filter) ExecOption + func WithLimit(limit query.Limit) ExecOption + func WithOrderBy(orderBy query.OrderBy) ExecOption + func WithTransaction(tx Tx) ExecOption + type Executor struct + func NewExecutor(querier Querier, opts ...ExecOption) *Executor + func (e *Executor) Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error) + func (e *Executor) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error) + func (e *Executor) QueryRow(ctx context.Context, sql string, args ...any) (pgx.Row, error) + type Migrations struct + func InitMigrations(cfg *MigrationsConfig) (*Migrations, error) + func (m *Migrations) Close() error + func (m *Migrations) Down() error + func (m *Migrations) Up() error + type MigrationsConfig struct + Location string + Pool *pgxpool.Pool + SchemaName string + Table string + type Module struct + func (m *Module) Configure(opts ...modules.Option) error + func (m *Module) Health(ctx context.Context) error + func (m *Module) Pool() *pgxpool.Pool + func (m *Module) Shutdown() error + func (m *Module) Start() (err error) + type Querier interface + Exec func(context.Context, string, ...any) (pgconn.CommandTag, error) + Query func(context.Context, string, ...any) (pgx.Rows, error) + QueryRow func(context.Context, string, ...any) pgx.Row + type Tx interface