Documentation
¶
Index ¶
- func OpenConn(cfg Config) (*pgx.Conn, error)
- func OpenPool(cfg Config, logger zerolog.Logger) (*pgxpool.Pool, error)
- func Query[T any](ctx context.Context, db Seeker, query string, args ...any) ([]T, error)
- func QueryStruct[T any](ctx context.Context, db Seeker, query string, args ...any) ([]T, error)
- func ToSQLX(pool *pgxpool.Pool) *sqlx.DB
- type Config
- type PoolConfig
- type Primitive
- type Seeker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryStruct ¶
Types ¶
type Config ¶
type Config struct {
Host string `validate:"required"`
User string `validate:"required"`
Password string `validate:"required"`
DBName string `validate:"required"`
SSLMode string `validate:"required"`
Socks5Proxy string
Pool PoolConfig
Port uint16 `validate:"required"`
LogQuery bool
}
func ConfigFromEnv ¶
type PoolConfig ¶
type Primitive ¶
type Primitive interface {
constraints.Ordered | uuid.UUID | decimal.Decimal | decimal.NullDecimal
}
Click to show internal directories.
Click to hide internal directories.