-
Notifications
You must be signed in to change notification settings - Fork 552
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
Add support for parsing placeholders #145
Comments
In the meantime you can apply this patch:
https://github.com/MaterializeInc/sqlparser/pull/17/files
I’ll look into getting it merged here. It works as you suggest with regards
to CREATE VIEW et al supporting expressions with placeholders. It does not
presently accept named placeholders, however.
…On Thu, Nov 21, 2019 at 7:03 PM Mitar ***@***.***> wrote:
Maybe I missed something, but I think placeholders are not yet supported
and cannot be parsed. I would like to ask if this could be added.
Ideally, with few extensions than a regular parser:
- In regular SQL queries, only SELECT, INSERT, UPDATE queries can have
placeholders. But for my use case it would be great if also other
statements can have them, like CREATE VIEW which takes a query, and
that one could have placeholders, because CREATE VIEW is specially
processed in my case. (See mit-pdos/noria#142
<mit-pdos/noria#142> for more information.)
- Common SQL databases support position-based placeholders, I would
love it some way of having keyword-based ones could be added. This then
maps very well to how one can provide values with a dict structure instead
of position.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/andygrove/sqlparser-rs/issues/145?email_source=notifications&email_token=AAGXSIFPWCFMLJMHF3IFLG3QU4OW5A5CNFSM4JQJZSCKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3IAILQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGXSIHW7UB7XYU2FS3OAY3QU4OW5ANCNFSM4JQJZSCA>
.
|
Yes, something like |
I'm also missing parameter placeholder support. We considered using sqlparser as the parser for a (for now) "demo" Rust-based frontend to our Rust-based data store backend. Ideally, it should become the default frontend. However, to support prepared statements, placeholder support is needed. In our SQL dialect, those are specified with a question mark, as used in most "large" RDBMSs, like MS SQL, Oracle SQL, SAP HANA DB SQL, etc. Would it be possible to add support for this as well? It should be fairly trivial extension to the patch above (though, it didn't land in the source code yet, so not sure whether it can be even applied). Thanks. |
Maybe I missed something, but I think placeholders are not yet supported and cannot be parsed. I would like to ask if this could be added.
Ideally, with few extensions than a regular parser:
CREATE VIEW
which takes a query, and that one could have placeholders, becauseCREATE VIEW
is specially processed in my case. (See Document SQL syntax used mit-pdos/noria#142 for more information.)The text was updated successfully, but these errors were encountered: