Trying out paginated cursortoken variant [UNTESTED]
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m11s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m11s
This commit is contained in:
@@ -120,25 +120,25 @@ func (c *Coll[TData]) createToken(fieldPrimary string, dirPrimary ct.SortDirecti
|
||||
|
||||
valuePrimary, err := c.getFieldValueAsTokenString(lastEntity, fieldPrimary)
|
||||
if err != nil {
|
||||
return ct.CursorToken{}, exerr.Wrap(err, "failed to get (primary) field-value as token-string").Type("lastEntity", lastEntity).Str("fieldPrimary", fieldPrimary).Build()
|
||||
return nil, exerr.Wrap(err, "failed to get (primary) field-value as token-string").Type("lastEntity", lastEntity).Str("fieldPrimary", fieldPrimary).Build()
|
||||
}
|
||||
|
||||
valueSeconary := ""
|
||||
if fieldSecondary != nil && dirSecondary != nil {
|
||||
valueSeconary, err = c.getFieldValueAsTokenString(lastEntity, *fieldSecondary)
|
||||
if err != nil {
|
||||
return ct.CursorToken{}, exerr.Wrap(err, "failed to get (secondary) field-value as token-string").Type("lastEntity", lastEntity).StrPtr("fieldSecondary", fieldSecondary).Build()
|
||||
return nil, exerr.Wrap(err, "failed to get (secondary) field-value as token-string").Type("lastEntity", lastEntity).StrPtr("fieldSecondary", fieldSecondary).Build()
|
||||
}
|
||||
}
|
||||
|
||||
return ct.CursorToken{
|
||||
Mode: ct.CTMNormal,
|
||||
ValuePrimary: valuePrimary,
|
||||
ValueSecondary: valueSeconary,
|
||||
Direction: dirPrimary,
|
||||
PageSize: langext.Coalesce(pageSize, 0),
|
||||
Extra: ct.Extra{},
|
||||
}, nil
|
||||
return ct.NewKeySortToken(
|
||||
valuePrimary,
|
||||
valueSeconary,
|
||||
dirPrimary,
|
||||
dirPrimary,
|
||||
langext.Coalesce(pageSize, 0),
|
||||
ct.Extra{},
|
||||
), nil
|
||||
}
|
||||
|
||||
func (c *Coll[TData]) needsDoubleSort(ctx context.Context) bool {
|
||||
|
Reference in New Issue
Block a user