Documentation
¶
Index ¶
- func ApplyCreatedAtFilter(base *gorm.DB, filter *registrystore.CreatedAtFilter, alias string, ...) *gorm.DB
- func ApplyEpochFilter(base *gorm.DB, epochFilter *registrystore.MemoryEpochFilter, ...) (*gorm.DB, error)
- func BoundedEntriesFromBase(ctx context.Context, base *gorm.DB, fromSeq *uint32, ...) ([]model.Entry, *string, *string, error)
- func FilterEntriesByCreatedAt(entries []model.Entry, filter *registrystore.CreatedAtFilter) []model.Entry
- func RunBoundedQuery(ctx context.Context, query BoundedQuery) ([]model.Entry, *string, *string, error)
- func UUIDStringValue(id uuid.UUID) any
- func UUIDValue(id uuid.UUID) any
- func WhereEntryOrderAtOrBeforeAlias(tx *gorm.DB, alias string, bound model.Entry, entryIDValue EntryIDValueFunc) *gorm.DB
- func WhereEntryOrderBeforeAlias(tx *gorm.DB, alias string, bound model.Entry, entryIDValue EntryIDValueFunc) *gorm.DB
- func WhereEntryOrderStrictlyAfterAlias(tx *gorm.DB, alias string, bound model.Entry, entryIDValue EntryIDValueFunc) *gorm.DB
- func WhereSeqOrderBeforeAlias(tx *gorm.DB, alias string, bound model.Entry, entryIDValue EntryIDValueFunc) *gorm.DB
- func WhereSeqOrderStrictlyAfterAlias(tx *gorm.DB, alias string, bound model.Entry, entryIDValue EntryIDValueFunc) *gorm.DB
- type BoundedQuery
- type CursorErrorFunc
- type EntryIDValueFunc
- type LookupFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyCreatedAtFilter ¶ added in v0.2.2
func ApplyCreatedAtFilter(base *gorm.DB, filter *registrystore.CreatedAtFilter, alias string, sqlite bool) *gorm.DB
ApplyCreatedAtFilter appends timestamp predicates to base. When sqlite is true the integer companion column created_at_unix_ms is used (milliseconds since Unix epoch) so that timezone-offset-bearing DATETIME text values compare as instants rather than strings.
func ApplyEpochFilter ¶
func ApplyEpochFilter(base *gorm.DB, epochFilter *registrystore.MemoryEpochFilter, latestWhenNil bool, latestErr string) (*gorm.DB, error)
func BoundedEntriesFromBase ¶
func FilterEntriesByCreatedAt ¶ added in v0.2.2
func FilterEntriesByCreatedAt(entries []model.Entry, filter *registrystore.CreatedAtFilter) []model.Entry
FilterEntriesByCreatedAt filters in-memory entries based on CreatedAtFilter.
func RunBoundedQuery ¶
func UUIDStringValue ¶
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
CreatedAtFilter *registrystore.CreatedAtFilter
// SQLite signals that ApplyCreatedAtFilter should use the integer
// created_at_unix_ms column instead of the DATETIME text column.
SQLite bool
}
type EntryIDValueFunc ¶
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.
Click to show internal directories.
Click to hide internal directories.