sql

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBTypePostgres = "PostgreSQL"
	DBTypeMySQL    = "MySQL"
)

Variables

This section is empty.

Functions

func NewSnapshotStore

func NewSnapshotStore(tableName string, db DB, registry registry.Registry) esourcing.AggregateStoreMiddleware

Types

type DB

type DB interface {
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	ExecContext(context.Context, string, ...any) (sql.Result, error)
	QueryContext(context.Context, string, ...any) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...any) *sql.Row
	DBType() string
}

type EventStore

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

func NewEventStore

func NewEventStore(tableName string, db DB, registry registry.Registry) EventStore

func (EventStore) Load

func (s EventStore) Load(ctx context.Context, aggregate esourcing.EventSourcedAggregate) (err error)

func (EventStore) Save

func (s EventStore) Save(ctx context.Context, aggregate esourcing.EventSourcedAggregate) (err error)

type InboxStore

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

func NewInboxStore

func NewInboxStore(tableName string, db DB) InboxStore

func (InboxStore) Save

type MySQLDB

type MySQLDB struct {
	sql.DB
}

func (*MySQLDB) DBType

func (m *MySQLDB) DBType() string

type OutboxStore

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

func NewOutboxStore

func NewOutboxStore(tableName string, db DB) OutboxStore

func (OutboxStore) FindUnpublished

func (s OutboxStore) FindUnpublished(ctx context.Context, limit int) ([]async.Message, error)

func (OutboxStore) MarkPublished

func (s OutboxStore) MarkPublished(ctx context.Context, ids ...string) (err error)

func (OutboxStore) Save

func (s OutboxStore) Save(ctx context.Context, msg async.Message) error

type PostgresDB

type PostgresDB struct {
	sql.DB
}

func (*PostgresDB) DBType

func (p *PostgresDB) DBType() string

type SagaStore

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

func NewSagaStore

func NewSagaStore(tableName string, db DB, registry registry.Registry) SagaStore

func (SagaStore) Load

func (s SagaStore) Load(ctx context.Context, sagaName, sagaID string) (*sec.SagaContext[[]byte], error)

func (SagaStore) Save

func (s SagaStore) Save(ctx context.Context, sagaName string, sagaCtx *sec.SagaContext[[]byte]) error

type SnapshotStore

type SnapshotStore struct {
	esourcing.AggregateStore
	// contains filtered or unexported fields
}

func (SnapshotStore) Load

func (SnapshotStore) Save

Jump to

Keyboard shortcuts

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