-
Notifications
You must be signed in to change notification settings - Fork 745
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
Added postgresql lexer. #1575
base: master
Are you sure you want to change the base?
Added postgresql lexer. #1575
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this and sorry it took a bit of time to get to it :(
I'm not very familiar with SQL but this looks like it's largely the same as the existing SQL lexer. I assume there are Postgres-specific syntax that this supports that isn't in the SQL lexer. Is that correct?
If that's the case, it would be better to subclass that lexer and then add anything you need that's extra. That way, bugs that get fixed in, or features that get added to, the SQL lexer will immediately benefit the Postgres lexer. Lexers that do this include the HQL lexer (which might be particularly relevant here) and the QML lexer.
Hello Michael,
The reason I didn't subclass the existing lexer is that there are keywords
there that aren't in PostgreSQL.
Also, the grammar will be different. Anonymous code blocks, Window
queries, Functions, etc.
Honestly, I'm not a strong Python programmer, so if you want me to go down
that road I'd need a bit of assistance to make the subclass.
Kirk Roybal
Principal Consultant
2ndQuadrant
…On Mon, 7 Sep 2020 at 20:36, Michael Camilleri ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Thanks for submitting this and sorry it took a bit of time to get to it :(
I'm not very familiar with SQL but this looks like it's largely the same
as the existing SQL lexer. I assume there are Postgres-specific syntax that
this supports that isn't in the SQL lexer. Is that correct?
If that's the case, it would be better to subclass that lexer and then add
anything you need that's extra. That way, bugs that get fixed in, or
features that get added to, the SQL lexer will immediately benefit the
Postgres lexer. Lexers that do this include the HQL lexer
<https://github.com/rouge-ruby/rouge/blob/6c9d1b7ca804ac80a9682cc8dbd416db0de38684/lib/rouge/lexers/hql.rb>
(which might be particularly relevant here) and the QML lexer
<https://github.com/rouge-ruby/rouge/blob/master/lib/rouge/lexers/qml.rb>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1575 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC3AFGZFEC2HBGQXLELCLLDSEWDDVANCNFSM4P47CVHQ>
.
|
Passes the small test and adds all the keywords for PostgreSQL. This fixes #1573.