feat: 🎸 Add custom sort support to sql parser (#2959)
* feat: 🎸 Add custom sort support to sql parser * test: 💍 fix column numner * refactor: 💡 apply pr feedback * fix: 🐛 use every method for checking attrs * refactor: 💡 PR feedback + ensure default sort * refactor: 💡 Consolidate attributes field when sorting ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17441 --------- Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
This commit is contained in:
1 parent
eab93cf6c5
commit
d414df4ca4
29 files changed
+333
-260
No files matched your search
@@ -303,7 +303,7 @@ module('Unit | Handler | sqlite-handler', function (hooks) {
|
||||
);
|
||||
|
||||
const results = await store.query('target', {
|
||||
query: { sort: { attribute: 'name' } },
|
||||
query: { sort: { attributes: ['name'] } },
|
||||
});
|
||||
|
||||
assert.deepEqual(
|
||||
@@ -345,10 +345,10 @@ module('Unit | Handler | sqlite-handler', function (hooks) {
|
||||
);
|
||||
|
||||
const resultsDesc = await store.query('target', {
|
||||
query: { sort: { attribute: 'name', direction: 'desc' } },
|
||||
query: { sort: { attributes: ['name'], direction: 'desc' } },
|
||||
});
|
||||
const resultsAsc = await store.query('target', {
|
||||
query: { sort: { attribute: 'name', direction: 'asc' } },
|
||||
query: { sort: { attributes: ['name'], direction: 'asc' } },
|
||||
});
|
||||
assert.deepEqual(
|
||||
resultsDesc.map(({ name }) => name),
|
||||
|
||||
Reference in new issue
Block a user