← Winnitude! Search  ·  Reader Mode (1508 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 32 LINKS

feat: add support for quoted alias by eortiz-tracktik · Pull Request #33 · JavaScriptor/js-sql-parser

Repository navigation

feat: add support for quoted alias - #33


Merged
albin3 merged 1 commit into JavaScriptor:master from TrackTik:master Mar 30, 2020
Merged

feat: add support for quoted alias #33 albin3 merged 1 commit into JavaScriptor:master from TrackTik:master

Conversation

eortiz-tracktik commented Mar 26, 2020



Copy link Copy Markdown
Contributor

We are using this parser and we would like to be able to use quoted alias like on the tests.
Basically, anything quoted should be safe as a quoted identifier?

Thanks.

feat: add support for quoted alias d3c4871

albin3 commented Mar 27, 2020



Copy link Copy Markdown
Member

@eortiz-tracktik It's an identifier in code.

https://github.com/JavaScriptor/js-sql-parser/blob/master/src/sqlParser.jison#L14

eortiz-tracktik commented Mar 27, 2020



Copy link Copy Markdown
Contributor

Author

@albin3 thanks for the quick response.
We have tried to use it, but is limited to some specific characters and we can't use some of the special characters we have put on the tests.

  it('support quoted alias', function() {
    testParser('select a as `A-A` from b limit 2;');
    testParser('select a as `A#A` from b limit 2;');
    testParser('select a as `A?A` from b limit 2;');
    testParser('select a as `A/B` from b limit 2;');
    testParser('select a as `A.A` from b limit 2;');
    testParser('select a as `A|A` from b limit 2;');
    testParser('select a as `A A` from b limit 2;');
  });

I saw that there was already the concept of QUOTED_IDENTIFIER but was also limited to certain characters.
I understand why we need to limit the allowed characters on regular identifiers, but if it's quoted I think we don't need to have this restriction.

albin3 merged commit bb66951 into JavaScriptor : master Mar 30, 2020

albin3 commented Mar 30, 2020



Copy link Copy Markdown
Member

@eortiz-tracktik you are right! thanks for this pr. 😺

albin3 commented Mar 30, 2020



Copy link Copy Markdown
Member

v1.2.2 has released.

eortiz-tracktik commented Mar 30, 2020



Copy link Copy Markdown
Contributor

Author

Thanks a lot to you @albin3 for this awesome project! 👏

billreynolds007 mentioned this pull request Sep 13, 2020 identifier double quoting support #44 Closed Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

None yet

2 participants