db

package
v0.0.0-...-b8997b0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(ctx context.Context, db *sql.DB) error

func Open

func Open(ctx context.Context, cfg Config) (*sql.DB, error)

func SeedDev

func SeedDev(ctx context.Context, db *sql.DB, opt SeedDevOptions) error

Types

type Config

type Config struct {
	Path string // e.g. "./data/portunus.db"; ":memory:" for an ephemeral DB
}

type SeedDevOptions

type SeedDevOptions struct {
	// Optional: you can pass your config-known modules here to pre-create them in dev.
	KnownModules []string
}

type TxFn

type TxFn func(ctx context.Context, tx *sql.Tx) error

type Worker

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

func NewWorker

func NewWorker(db *sql.DB) *Worker

func (*Worker) Close

func (w *Worker) Close()

func (*Worker) Do

func (w *Worker) Do(ctx context.Context, fn TxFn) error

Jump to

Keyboard shortcuts

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