postgres

package
v0.0.0-...-d54a50e Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 9 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 = postgres.DB[*sqlc.Queries]

DB is a type alias for the generic knowhere DB with sqlc.Queries

func NewDB

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

NewDB creates a new database 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