Storage: Add ascending order support for NotOlderThan queries and introduce ResourceVersionMatch_Unset as default (#102505)

* Add support for ASC ordering and introduce ResourceVersionMatch_Unset as default
Add SortAscending to continue token and add integration test for pagination.

* Change protobuf order

* Make backwards compatible

* Update pkg/storage/unified/sql/backend.go

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>

---------

Co-authored-by: Marco de Abreu <18629099+marcoabreu@users.noreply.github.com>
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
This commit is contained in:
Marco de Abreu
2025-03-21 18:35:32 +02:00
committed by GitHub
co-authored by Jean-Philippe Quéméner Marco de Abreu
parent 7d435e5d84
commit 6d570db312
11 changed files with 1204 additions and 695 deletions
+6 -5
View File
@@ -243,11 +243,12 @@ func (r *sqlResourceHistoryDeleteRequest) Validate() error {
type sqlGetHistoryRequest struct {
sqltemplate.SQLTemplate
Key *resource.ResourceKey
Trash bool // only deleted items
StartRV int64 // from NextPageToken
MinRV int64 // minimum resource version for NotOlderThan
ExactRV int64 // exact resource version for Exact
Key *resource.ResourceKey
Trash bool // only deleted items
StartRV int64 // from NextPageToken
MinRV int64 // minimum resource version for NotOlderThan
ExactRV int64 // exact resource version for Exact
SortAscending bool // if true, sort by resource_version ASC, otherwise DESC
}
func (r sqlGetHistoryRequest) Validate() error {