db

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Connect() error
	Close() error
	Connection() *sqlx.DB
	Migrate(ctx context.Context, options *MigrationOptions) (*MigrationResult, error)
	Tx(ctx context.Context, tx TxFn) error
	EventTx(ctx context.Context, etx EventTxFn) (*events.EventID, error)
	EventsTx(ctx context.Context, etx EventsTxFn) ([]events.EventID, error)
}

type EventTxFn

type EventTxFn func(ctx context.Context, tx *sqlx.Tx) (*events.EventSpec, error)

type EventsTxFn

type EventsTxFn func(ctx context.Context, tx *sqlx.Tx) ([]*events.EventSpec, error)

type MigrationOptions

type MigrationOptions struct {
	DropTablesBeforeMigrating bool
}

type MigrationResult

type MigrationResult struct {
	AppliedMigrations []string
}

type Migrator

type Migrator interface {
	Migrate(ctx context.Context, dsn string) (*MigrationResult, error)
}

type TxFn

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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