postgres

package
v0.0.0-...-da74aa7 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateDown

func MigrateDown(databaseURL string) error

MigrateDown rolls back the last migration

func MigrateUp

func MigrateUp(databaseURL string) error

MigrateUp applies all pending migrations

func MigrateVersion

func MigrateVersion(databaseURL string) (uint, bool, error)

MigrateVersion returns the current migration version

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB wraps the PostgreSQL connection pool

func NewDB

func NewDB(ctx context.Context, connString string) (*DB, error)

NewDB creates a new database connection with the given connection string

func (*DB) Close

func (db *DB) Close()

Close closes the database connection pool

func (*DB) Pool

func (db *DB) Pool() *pgxpool.Pool

Pool returns the underlying connection pool

type TemplatesDB

type TemplatesDB struct {
	// contains filtered or unexported fields
}

TemplatesDB handles database operations for email templates

func NewTemplatesDB

func NewTemplatesDB(db *DB) *TemplatesDB

NewTemplatesDB creates a new templates database adapter

func (*TemplatesDB) Create

func (r *TemplatesDB) Create(ctx context.Context, template *email.Template) (*email.Template, error)

Create inserts a new email template

func (*TemplatesDB) GetTemplate

func (r *TemplatesDB) GetTemplate(ctx context.Context, name string) (*email.Template, error)

GetTemplate retrieves a template by its name

func (*TemplatesDB) List

func (r *TemplatesDB) List(ctx context.Context) ([]*email.Template, error)

List retrieves all email templates, optionally filtered by name

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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