-
Notifications
You must be signed in to change notification settings - Fork 46
feat: add support for quoted alias #33
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
Conversation
@eortiz-tracktik It's an identifier in code.
https://github.com/JavaScriptor/js-sql-parser/blob/master/src/sqlParser.jison#L14
@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.
@eortiz-tracktik you are right! thanks for this pr. 😺
v1.2.2
has released.
Thanks a lot to you @albin3 for this awesome project! 👏
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.