Skip to content

Commit

Permalink
List results in alphabetical order
Browse files Browse the repository at this point in the history
  • Loading branch information
neoaggelos committed Feb 28, 2024
1 parent b93691e commit 15c405b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/kine/drivers/generic/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var (
ON maxkv.id = kv.id
WHERE
(kv.deleted = 0 OR ?)
ORDER BY kv.id ASC
ORDER BY kv.name ASC, kv.id ASC
`, columns)

// FIXME this query doesn't seem sound.
Expand Down
4 changes: 2 additions & 2 deletions test/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestList(t *testing.T) {
g := NewWithT(t)

// Create some keys
keys := []string{"/key/1", "/key/2", "/key/3"}
keys := []string{"/key/2", "/key/1", "/key/3"}
for _, key := range keys {
resp, err := client.Txn(ctx).
If(clientv3.Compare(clientv3.ModRevision(key), "=", 0)).
Expand Down Expand Up @@ -46,7 +46,7 @@ func TestList(t *testing.T) {
t.Run("ListPrefix", func(t *testing.T) {
g := NewWithT(t)
// Create some keys
keys := []string{"key/sub/1", "key/sub/2", "key/other/1"}
keys := []string{"key/sub/2", "key/sub/1", "key/other/1"}
for _, key := range keys {
resp, err := client.Txn(ctx).
If(clientv3.Compare(clientv3.ModRevision(key), "=", 0)).
Expand Down

0 comments on commit 15c405b

Please sign in to comment.