dbx

package
v1.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*db.Client
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, config Config, opts ...Option) (*Client, error)

type Config

type Config struct {
	Host        string `validate:"required" schema:"Хост"`
	Port        int    `validate:"required" schema:"Порт"`
	Database    string `validate:"required" schema:"База данных"`
	Username    string `schema:"Логин"`
	Password    string `schema:"Пароль"`
	Schema      string `schema:"Схема"`
	MaxOpenConn int    `` /* 176-byte string literal not displayed */
}

func (Config) Dsn

func (c Config) Dsn() string

type LogTracer

type LogTracer struct {
	// contains filtered or unexported fields
}

func NewLogTracer

func NewLogTracer(logger log.Logger) LogTracer

func (LogTracer) TraceQueryEnd

func (l LogTracer) TraceQueryEnd(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryEndData)

func (LogTracer) TraceQueryStart

func (l LogTracer) TraceQueryStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryStartData) context.Context

type MigrationRunner

type MigrationRunner interface {
	Run(ctx context.Context, db *sql.DB, gooseOpts ...goose.ProviderOption) error
}

type Option

type Option func(db *Client)

func WithMigrationRunner

func WithMigrationRunner(migrationDir string, logger log.Logger) Option

func WithQueryTracer

func WithQueryTracer(tracers ...pgx.QueryTracer) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL