postgres

package
v0.0.0-...-7f86f56 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

type Postgres interface {
	Begin(ctx context.Context) (pgx.Tx, error)
	Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
	Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
}

Postgres driver interface.

func NewPool

func NewPool(cfg *PostgresConfig) (Postgres, error)

Creating a new postgres pool connection.

type PostgresConfig

type PostgresConfig struct {
	URL      string
	MaxConns int32
	MinConns int32
}

Postgres config structure.

func (*PostgresConfig) Configure

func (c *PostgresConfig) Configure(cfg *pgxpool.Config)

Configure postgres driver.

Jump to

Keyboard shortcuts

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