Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: AGPL-3.0 Imports: 5 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 {
	Host            string
	Port            int
	Database        string
	User            string
	Password        string
	SSLMode         string
	MaxOpenConns    int
	MaxIdleConns    int
	ConnMaxLifetime time.Duration
	ConnMaxIdleTime time.Duration
}

Config holds database configuration

type DB

type DB struct {
	*sql.DB
	// contains filtered or unexported fields
}

DB wraps SQL database connection

func New

func New(cfg Config, logger *zap.Logger) (*DB, error)

New creates a new PostgreSQL database connection

func (*DB) Analyze

func (db *DB) Analyze() error

Analyze updates database statistics

func (*DB) Close

func (db *DB) Close() error

Close closes database connection

func (*DB) Vacuum

func (db *DB) Vacuum() error

Vacuum performs database maintenance (PostgreSQL equivalent of SQLite VACUUM)

Jump to

Keyboard shortcuts

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