mysql

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoDSN      = errors.New("no dsn provided")
	ErrNoMigrator = errors.New("no migrator provided")
)
View Source
var (
	ErrNoOutboxConfigured = errors.New("no event outbox configured")
)

Functions

This section is empty.

Types

type MySQL

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

func New

func New(options Options) (*MySQL, error)

func (*MySQL) Close

func (db *MySQL) Close() error

func (*MySQL) Connect

func (db *MySQL) Connect() error

func (*MySQL) Connection

func (db *MySQL) Connection() *sqlx.DB

func (*MySQL) EventTx

func (db *MySQL) EventTx(ctx context.Context, etxFn db.EventTxFn) (eventId *events.EventID, err error)

EventTx is a convenience method for emitting a single event in a single transaction.

func (*MySQL) EventsTx

func (db *MySQL) EventsTx(ctx context.Context, etxFn db.EventsTxFn) (eventIds []events.EventID, err error)

EventsTx is a convenience method for emitting multiple events in a single transaction.

func (*MySQL) Migrate

func (db *MySQL) Migrate(ctx context.Context, options *db.MigrationOptions) (*db.MigrationResult, error)

func (*MySQL) Tx

func (db *MySQL) Tx(ctx context.Context, txFn db.TxFn) (err error)

type Options

type Options struct {
	DSN           string
	OutboxOptions *outbox.Options
	Logger        *zap.Logger
	Migrator      db.Migrator
}

Jump to

Keyboard shortcuts

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