-
Notifications
You must be signed in to change notification settings - Fork 217
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
sqlite query generation REGEXP doesn't work. #4540
Comments
Is there a minimal example? I see the SQL in the linked issue but can't see the PRQL. |
timeseries/qstudio#50 is my report. The underlying conundrum is that SQLite does not ship with a built-in REGEXP facility. When qStudio calls There are a few alternatives:
Update: @ryanhamilton has also raised an issue at nalgeon/sqlean#119 |
OK, thanks. So it sounds the minimal example: prql target:sql.sqlite
from foo
derive x ~= 'bar$' ...shouldn't generate... SELECT
*,
x REGEXP 'bar$'
FROM
foo
-- Generated by PRQL compiler version:0.11.3 (https://prql-lang.org) ...I do remember seeing some issues that regex isn't natively implemented by sqlite. One option would be to inspect the regex and generate a |
Let's hold off to see what Ryan discovers. (I'm not in a rush - the If it turns out to be straightforward to get more addin functions into the SQLite that's bundled into qStudio, that'll be a win for all. |
Sqlean said now. Last chance is for xerial to create a fat jar: |
Thanks for the update |
@ryanhamilton @richb-hanover Doesn't |
@PrettyWood - that appears to be a very good workaround. Here is the use-case that triggered the original report:
qStudio's SQLite implementation doesn't bundle in the REGEXP addin, and therefore gives an error. @ryanhamilton is looking to see if there is another SQLite JDBC that might bundle it. You are correct that it covers the majority of situations well. I am content to close this issue as "Solved". |
What's up?
By default PRQL seems to generate sqlite queries with REGEXP.
This means code like this doesn't work:
timeseries/qstudio#50
If where possible PRQL avoided REGEXP and used LIKE many more queries may work out of the box.
REGEXP is also risky to use as the implentation depends on the platform so users may get different results.
The text was updated successfully, but these errors were encountered: