postgres

package
v0.0.0-...-d726b9d Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool(ctx context.Context, cfg ConfigProvider, log logger.ILogger) *pgxpool.Pool

Types

type ConfigProvider

type ConfigProvider interface {
	GetDbUsername() string
	GetDbPassword() string
	GetDbHost() string
	GetDbPort() int
	GetDbDefaultName() string
}

ConfigProvider is the interface for providing the db configurations.

type MultiQueryTracer

type MultiQueryTracer struct {
	Tracers []pgx.QueryTracer
}

func (*MultiQueryTracer) TraceQueryEnd

func (m *MultiQueryTracer) TraceQueryEnd(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryEndData)

func (*MultiQueryTracer) TraceQueryStart

func (m *MultiQueryTracer) TraceQueryStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryStartData) context.Context

type MyQueryTracer

type MyQueryTracer struct {
	Log logger.ILogger
}

func (*MyQueryTracer) TraceQueryEnd

func (tracer *MyQueryTracer) TraceQueryEnd(ctx context.Context, _ *pgx.Conn, data pgx.TraceQueryEndData)

func (*MyQueryTracer) TraceQueryStart

func (tracer *MyQueryTracer) TraceQueryStart(
	ctx context.Context,
	_ *pgx.Conn,
	data pgx.TraceQueryStartData) context.Context

Jump to

Keyboard shortcuts

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