postgres

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 Options

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

type PostgresSQL

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

func New

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

func (*PostgresSQL) Close

func (db *PostgresSQL) Close() error

func (*PostgresSQL) Connect

func (db *PostgresSQL) Connect() error

func (*PostgresSQL) Connection

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

func (*PostgresSQL) EventTx

func (db *PostgresSQL) 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 (*PostgresSQL) EventsTx

func (db *PostgresSQL) 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 (*PostgresSQL) Migrate

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

func (*PostgresSQL) Tx

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

Jump to

Keyboard shortcuts

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