sql

package
v0.0.0-...-860e413 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDB

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

func NewCRDB

func NewCRDB(client *sql.DB) *CRDB

func (*CRDB) CreateInstance

func (db *CRDB) CreateInstance(ctx context.Context, instanceID string) error

func (*CRDB) Filter

func (db *CRDB) Filter(ctx context.Context, searchQuery *repository.SearchQuery) (events []*repository.Event, err error)

Filter returns all events matching the given search query

func (*CRDB) Health

func (db *CRDB) Health(ctx context.Context) error

func (*CRDB) InstanceIDs

func (db *CRDB) InstanceIDs(ctx context.Context, searchQuery *repository.SearchQuery) ([]string, error)

InstanceIDs returns the instance ids found by the search query

func (*CRDB) LatestSequence

func (db *CRDB) LatestSequence(ctx context.Context, searchQuery *repository.SearchQuery) (uint64, error)

LatestSequence returns the latest sequence found by the search query

func (*CRDB) Push

func (db *CRDB) Push(ctx context.Context, events []*repository.Event, uniqueConstraints ...*repository.UniqueConstraint) error

Push adds all events to the eventstreams of the aggregates. This call is transaction save. The transaction will be rolled back if one event fails

type Data

type Data []byte

Data represents a byte array that may be null. Data implements the sql.Scanner interface

func (*Data) Scan

func (data *Data) Scan(value interface{}) error

Scan implements the Scanner interface.

func (Data) Value

func (data Data) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Sequence

type Sequence uint64

Sequence represents a number that may be null. Sequence implements the sql.Scanner interface

func (*Sequence) Scan

func (seq *Sequence) Scan(value interface{}) error

Scan implements the Scanner interface.

func (Sequence) Value

func (seq Sequence) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

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