postgresql

package
v0.0.0-...-e7a9347 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	User        string `koanf:"APP_POSTGRES_USER"`
	Password    string `koanf:"APP_POSTGRES_PASSWORD"`
	Host        string `koanf:"APP_POSTGRES_HOST"`
	Port        string `koanf:"APP_POSTGRES_PORT"`
	DBName      string `koanf:"APP_POSTGRES_DB_NAME"`
	Query       string `koanf:"APP_POSTGRES_QUERY"`
	WithMigrate bool   `koanf:"APP_POSTGRES_WITH_MIGRATION"`
}

type Postgres

type Postgres struct {
	Pool      *pgxpool.Pool
	Builder   squirrel.StatementBuilderType
	Migration *migrate.Migrate
}

func Build

func Build(ctx context.Context, cfg Config, migrationPath string) (*Postgres, error)

func (*Postgres) Close

func (p *Postgres) Close()

func (*Postgres) MigrateDown

func (p *Postgres) MigrateDown() error

func (*Postgres) MigrateUp

func (p *Postgres) MigrateUp() error

Jump to

Keyboard shortcuts

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