-
Notifications
You must be signed in to change notification settings - Fork 21
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
WITH clause doesn't work with SQLite #50
Comments
Hey @n87, thank you for opening the issue :)
https://github.com/jupyter-xeus/xeus-sql/blob/master/src/xeus_sql_interpreter.cpp#L295-L317 Here are some things I'm thinking could be the culprit for this issue:
I'm not sure, these are just some hints. If you or anyone want to tackle this issue I'm here to help. |
@marimeireles it looks like your snippet is just enough to explain the issue. You check that first token is one of (SELECT, DESC, DESCRIBE, SHOW). But SELECT queries can also start with Note that |
Hum! This is where my lack of knowledge in SQL attacks again! Yeah, seems a bit complicated. If I understand correctly this I can't tell if SOCI offers support for it, because they have no entries about Afterwards... I'd say the steps to fix this would be:
|
A more googlable term for WITH clause is Common Table Expression. It is like defining variables, but more closer equivalent is
Somewhat contrived SQL(ite) equivalent:
|
Just came across this issue. Wanted to use Jupyter to teach Common Table Expressions, but seems it doesnt work :(. Is it just a matter of whitelisting the missing Please could we just add this as a quick fix? 🙏 |
Hey @darkdreamingdan, this is not a simple issue, unfortunately. My explanation in the previous comment is a bit confusing but I think there are two parts of this issue:
I'll try to tackle it this week. Will keep you updated of any progress. Another thing you could try is opening an issue in SOCI and asking them about the possibility of including this feature. If they support it then I'll add it here, as it's very easy to :) |
Seeing same issue, so I came here to see if this was previously reported. And you're already working it! Thank you very, very much for these wonderful tools! :tracking: |
Sorry to bring up this topic again. I'm having pretty much the same use case as @darkdreamingdan. I'd love to use xeus-sql to teach students how to use SQL. It's pretty much perfect for my use-case, except for this issue. We'd like to teach them the benefit of structuring queries using I'm not having much knowledge about C++, but it seems to me, these lines here determine which kind of queries are displaying a result in the notebook, based on the first keyword. Syntactically the xeus-sql/src/xeus_sql_interpreter.cpp Lines 312 to 315 in 315057d
Let me know what you think! |
Tested on these queries in the cloud demo [1]:
It doesn't output anything, but also doesn't show errors
[1] https://mybinder.org/v2/gh/jupyter-xeus/xeus-sql/stable?urlpath=lab/tree/examples/XVega%20operations.ipynb
The text was updated successfully, but these errors were encountered: