sqlentry

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyEpochFilter

func ApplyEpochFilter(base *gorm.DB, epochFilter *registrystore.MemoryEpochFilter, latestWhenNil bool, latestErr string) (*gorm.DB, error)

func BoundedEntriesFromBase

func BoundedEntriesFromBase(ctx context.Context, base *gorm.DB, fromSeq *uint32, afterEntryID, beforeEntryID *string, tail bool, limit int, lookup LookupFunc, cursorEntryError CursorErrorFunc, entryIDValue EntryIDValueFunc, scanErr string) ([]model.Entry, *string, *string, error)

func RunBoundedQuery

func RunBoundedQuery(ctx context.Context, query BoundedQuery) ([]model.Entry, *string, *string, error)

func UUIDStringValue

func UUIDStringValue(id uuid.UUID) any

func UUIDValue

func UUIDValue(id uuid.UUID) any

func WhereEntryOrderAtOrBeforeAlias

func WhereEntryOrderAtOrBeforeAlias(tx *gorm.DB, alias string, bound model.Entry, entryIDValue EntryIDValueFunc) *gorm.DB

func WhereEntryOrderBeforeAlias

func WhereEntryOrderBeforeAlias(tx *gorm.DB, alias string, bound model.Entry, entryIDValue EntryIDValueFunc) *gorm.DB

func WhereEntryOrderStrictlyAfterAlias

func WhereEntryOrderStrictlyAfterAlias(tx *gorm.DB, alias string, bound model.Entry, entryIDValue EntryIDValueFunc) *gorm.DB

func WhereSeqOrderBeforeAlias

func WhereSeqOrderBeforeAlias(tx *gorm.DB, alias string, bound model.Entry, entryIDValue EntryIDValueFunc) *gorm.DB

func WhereSeqOrderStrictlyAfterAlias

func WhereSeqOrderStrictlyAfterAlias(tx *gorm.DB, alias string, bound model.Entry, entryIDValue EntryIDValueFunc) *gorm.DB

Types

type BoundedQuery

type BoundedQuery struct {
	Base             *gorm.DB
	FromSeq          *uint32
	UpToEntryID      *string
	AfterEntryID     *string
	BeforeEntryID    *string
	Tail             bool
	Limit            int
	MaxLimit         int
	UpToLookup       LookupFunc
	BaseTransform    func(*gorm.DB) (*gorm.DB, error)
	CursorEntryError CursorErrorFunc
	LimitError       func(int) error
	EntryNotFound    func(string) error
	EntryIDValue     EntryIDValueFunc
	ScanErr          string
}

type CursorErrorFunc

type CursorErrorFunc func(context.Context, string, string) error

type EntryIDValueFunc

type EntryIDValueFunc func(uuid.UUID) any

EntryIDValueFunc converts a UUID entry id into the value shape expected by a datastore/dialect. PostgreSQL compares UUID values directly, while SQLite stores entry ids as text.

type LookupFunc

type LookupFunc func(string) (model.Entry, bool, error)

Jump to

Keyboard shortcuts

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