postgres

package
v0.0.0-...-9139af7 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvDSN is the key of the DSN for the Postgres database
	EnvDSN = "URU_FRAMEWORKS_SECURE_NOTES_POSTGRES_DSN"

	// EnvMaxOpenConnections is the key of the maximum number of open connections for the Postgres database
	EnvMaxOpenConnections = "URU_FRAMEWORKS_SECURE_NOTES_POSTGRES_MAX_OPEN_CONNECTIONS"

	// EnvMaxIdleConnections is the key of the maximum number of idle connections for the Postgres database
	EnvMaxIdleConnections = "URU_FRAMEWORKS_SECURE_NOTES_POSTGRES_MAX_IDLE_CONNECTIONS"
)

Variables

View Source
var (
	// DSN is the DSN for the Postgres database
	DSN string

	// MaxOpenConnections is the maximum number of open connections for the Postgres database
	MaxOpenConnections int

	// MaxIdleConnections is the maximum number of idle connections for the Postgres database
	MaxIdleConnections int

	// PoolHandler is the Postgres pool handler
	PoolHandler godatabasespgxpool.PoolHandler

	// PoolService is the Postgres pool service
	PoolService *Service
)
View Source
var (
	ErrNilService   = errors.New("database service cannot be nil")
	ErrNilRow       = errors.New("row cannot be nil")
	ErrUserNotFound = errors.New("user not found")
)

Functions

func Load

func Load(mode *goflagsmode.Flag)

Load loads the Postgres constants

Types

type Service

type Service struct {
	godatabasespgxpool.Service
}

Service is the Postgres service struct

func NewService

func NewService(pool *pgxpool.Pool) (
	*Service,
	error,
)

NewService creates a new Postgres service

func (*Service) Migrate

func (s *Service) Migrate() error

Migrate migrates the database

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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