Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into add-place-holder-support
  • Loading branch information
sockstack authored Jul 27, 2021
commit 4200a15de925682fc5fc141b90d0ca82b255d08a
25 changes: 22 additions & 3 deletions test/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,30 @@ describe('select grammar support', function () {

it('bugfix table alias2', function () {
testParser('select a.* from a t1 join b t2 on t1.a = t2.a')
})

});
it('place holder support', function() {
testParser(
"select sum(quota_value) value, busi_col2 as sh, ${a} as a, YEAR(now()) from der_quota_summary where table_ename = 'gshmyyszje_derivedidx' and cd = (select id from t1 where a = ${t1})"
)
})
});

it('support quoted alias: multiple alias and orderby support', function () {
testParser('select a as `A A`, b as `B B` from z');
testParser('select a as `A A` from z order by `A A` desc');
testParser('select a as `A A`, b as `B B` from z group by `A A`, `B B` order by `A A` desc');
});

it('support double quoted alias', function () {
testParser('select a as "A A" from z');
testParser('select a as "A A" from z order by "A A" desc');
});

it('support quoted alias', function () {
testParser('select a as \'A A\' from z');
testParser('select a as \'"A#A\' from z order by \'"A#A\' desc');
});

it('test IDENTIFIER', function () {
testParser('select `aa#sfs`(a) as \'A A\' from z');
});
});
You are viewing a condensed version of this merge commit. You can view the full changes here.