unified-storage: add Keys support to the sqlkv implementation (#115510)

* unified-storage: add `Keys` support to the sqlkv implementation

* add validation for sort option

* Revert sort order validation, assume desc when invalid
This commit is contained in:
Renato Costa
2025-12-17 15:03:59 -05:00
committed by GitHub
parent 5861b6c0d5
commit 370d5c2dc2
4 changed files with 179 additions and 61 deletions
@@ -0,0 +1,9 @@
SELECT {{ .Ident "key_path" }}
FROM {{ .TableName }}
WHERE {{ .Ident "key_path" }} >= {{ .Arg .StartKey }}
AND {{ .Ident "key_path" }} < {{ .Arg .EndKey }}
ORDER BY {{ .Ident "key_path" }} {{ if .SortAscending }}ASC{{ else }}DESC{{ end }}
{{ if .Options.Limit }}
LIMIT {{ .Options.Limit }}
{{ end }}
;