db

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 3 Imported by: 0

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