database

package
v0.0.0-...-955c200 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 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 DBTX

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

type Event

type Event struct {
	PartitionKey uuid.UUID
	SortingKey   int64
	EventPayload []byte
}

type InsertEventSequenceParams

type InsertEventSequenceParams struct {
	PartitionKey uuid.UUID
	SortingKey   int64
	EventPayload []byte
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetLastEvent

func (q *Queries) GetLastEvent(ctx context.Context, partitionKey uuid.UUID) (Event, error)

func (*Queries) InsertEventSequence

func (q *Queries) InsertEventSequence(ctx context.Context, arg InsertEventSequenceParams) error

func (*Queries) RangeEvents

func (q *Queries) RangeEvents(ctx context.Context, arg RangeEventsParams) ([]RangeEventsRow, error)

func (*Queries) RangeEventsWithStop

func (q *Queries) RangeEventsWithStop(ctx context.Context, arg RangeEventsWithStopParams) ([]RangeEventsWithStopRow, error)

func (*Queries) UpsertEvent

func (q *Queries) UpsertEvent(ctx context.Context, arg UpsertEventParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type RangeEventsParams

type RangeEventsParams struct {
	PartitionKey    uuid.UUID
	Limit           int32
	StartSortingKey int64
}

type RangeEventsRow

type RangeEventsRow struct {
	SortingKey   int64
	EventPayload []byte
}

type RangeEventsWithStopParams

type RangeEventsWithStopParams struct {
	PartitionKey    uuid.UUID
	Limit           int32
	StartSortingKey int64
	StopSortingKey  int64
}

type RangeEventsWithStopRow

type RangeEventsWithStopRow struct {
	SortingKey   int64
	EventPayload []byte
}

type UpsertEventParams

type UpsertEventParams struct {
	PartitionKey uuid.UUID
	SortingKey   int64
	EventPayload []byte
}

Jump to

Keyboard shortcuts

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