database

package
v0.0.0-...-c163e03 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(db *sql.DB, maxRetries int, delay time.Duration) error

func MustOpen

func MustOpen(db *sql.DB, err error) *sql.DB

func Open

func Open(config PostgresConfig) (*sql.DB, error)

Open will open a SQL connection with the provided Postgres database. *sql.DB should be closed.

func OpenPool

func OpenPool(ctx context.Context, config PostgresConfig) (*sql.DB, error)

OpenPool will open a SQL Pool connection with the provided Postgres database. *sql.DB should be closed.

Types

type PostgresConfig

type PostgresConfig struct {
	Host     string
	Port     string
	User     string
	Password string
	Database string
	SSLMode  string
}

func (PostgresConfig) String

func (pc PostgresConfig) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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