Documentation ¶
Index ¶
- Constants
- Variables
- func BuildDSN(user, password, host, database string, port uint, queryOpts ...string) *url.URL
- func New() components.Component
- func WithDSN(dsn string) components.Option
- func WithDatabase(database string) components.Option
- func WithHost(host string) components.Option
- func WithMigrations(location string) components.Option
- func WithPassword(password string) components.Option
- func WithPort(port uint) components.Option
- func WithUser(user string) components.Option
- type CloseTx
- type Component
- type ExecOption
- type Executor
- type Migrations
- type MigrationsConfig
- type QueryFilter
- type Tx
Constants ¶
View Source
const (
ComponentName = "postgresdb"
)
Variables ¶
Functions ¶
func New ¶
func New() components.Component
func WithDSN ¶
func WithDSN(dsn string) components.Option
func WithDatabase ¶
func WithDatabase(database string) components.Option
func WithHost ¶
func WithHost(host string) components.Option
func WithMigrations ¶
func WithMigrations(location string) components.Option
func WithPassword ¶
func WithPassword(password string) components.Option
func WithPort ¶
func WithPort(port uint) components.Option
func WithUser ¶
func WithUser(user string) components.Option
Types ¶
type Component ¶
type Component struct { components.Base // contains filtered or unexported fields }
type ExecOption ¶
type ExecOption func(*Executor)
func WithFilter ¶
func WithFilter(filter QueryFilter) ExecOption
func WithTransaction ¶
func WithTransaction(tx Tx) ExecOption
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
func NewExecutor(dbpool *pgxpool.Pool, opts ...ExecOption) *Executor
type Migrations ¶
type Migrations struct {
// contains filtered or unexported fields
}
func InitMigrations ¶
func InitMigrations(cfg *MigrationsConfig) (*Migrations, error)
func (*Migrations) Down ¶
func (m *Migrations) Down() error
func (*Migrations) Up ¶
func (m *Migrations) Up() error
type MigrationsConfig ¶
type QueryFilter ¶
Click to show internal directories.
Click to hide internal directories.