-
Notifications
You must be signed in to change notification settings - Fork 3
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
Colon in sql comments results in error #12
Comments
That's because YeshQL doesn't actually parse SQL - it can't, because that would require knowing which SQL dialect we're dealing with, and for most of them, also the current server configuration (most SQL DBMSes have configurable syntax; e.g., MySQL can be configured to accept different styles of commenting and quoting). Hence, SQL syntax, including comment markers, are completely ignored, and YeshQL simply attempts to pick up anything that looks like its own syntax, which, by design, includes colons. I'm not quite sure how to make this example work without making rather intrusive changes to the design, but if you have an idea, I'm all ears. |
I am thinking use some kind of heuristics instead of parsing the sql, but I am not very clear how it can be done. |
One way to do it would be to have some sort of escaping mechanism; then you
could just write \: to indicate a literal colon (which would also solve the
problem that you cannot currently write PostgreSQL type annotations in your
queries). Only downside with that is that legit \ also has to be escaped,
which could cause multiple escaping hell. I still think it's a good idea
though, so maybe I'll implement it (or if you want to volunteer, go ahead).
…On Tue, Mar 31, 2020, 18:29 Mihai Giurgeanu ***@***.***> wrote:
I am thinking use some kind of heuristics instead of parsing the sql, but
I am not very clear how it can be done.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#12 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK6HR43P3R35I633MGXQ7DRKIK7RANCNFSM4LXCGHPA>
.
|
Parsing SQL that contains comments with colons results in error. Herer it is a sample of SQL to reproduce the error:
The text was updated successfully, but these errors were encountered: