db

package
v0.0.0-...-0137b07 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package db provides logic to connect to a database

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Queries() *sqlc.Queries
	WithRollback(ctx context.Context, fn func(q *sqlc.Queries) error) error
	Pool() *pgxpool.Pool
}

DB represents a database connection

func NewPSQL

func NewPSQL(options PSQLOptions) (DB, error)

NewPSQL creates a new postgres database connection

type PSQLOptions

type PSQLOptions struct {
	Host     string // Default: localhost
	Port     uint16 // Default: 5432
	Database string // Default: postgres
	User     string // Default: postgres
	Password string // Default: postgres
}

PSQLOptions are the different configuration options for a postgres connection

Jump to

Keyboard shortcuts

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