Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for quoted alias #33

Merged
merged 1 commit into from
Mar 30, 2020
Merged

feat: add support for quoted alias #33

merged 1 commit into from
Mar 30, 2020

Conversation

eortiz-tracktik
Copy link
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.

@albin3
Copy link
Member

albin3 commented Mar 27, 2020

@eortiz-tracktik
Copy link
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 albin3 merged commit bb66951 into JavaScriptor:master Mar 30, 2020
@albin3
Copy link
Member

albin3 commented Mar 30, 2020

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

@albin3
Copy link
Member

albin3 commented Mar 30, 2020

v1.2.2 has released.

@eortiz-tracktik
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants