-
Notifications
You must be signed in to change notification settings - Fork 40
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
SELECT query on standard database with geopoly virtual table fails #235
Comments
Interesting. I'll do some experimentation with that database on my local development setup, and figure out what's going wrong. Hopefully it won't be too hard to fix. 😄 |
Debugging this now, it looks like that query is (somehow) causing a bunch of INSERT, UPDATE, and DELETE statements to run. Debugging output from our SQLite Authorizer function (while running in my local dev desktop):
Naturally, INSERT/UPDATE/DELETE aren't super great in what's supposed to be a read only database. I'm not (yet) sure how that SELECT is turning into a bunch of statements that modify the database. Will probably need to check out the Geopoly stuff next, as that'll probably clue me in. Will spend some more time on this today, and hopefully figure things out. It might be as simple as just needing to add the geopoly extension to the server or something, which hopefully will change things to not try altering the database (for read only databases). Will find out... 😄 |
Oh hang on, we already compile SQLite with the geopoly extension (sorry, I forgot that). So it's not going to be completely that simple. |
Attacking this problem from a different direction... the query seems to execute as expected when the database is uploaded as a live database though. Maybe go with that approach instead? 😄 |
I might have tried that. Not 100% sure, will try again, but I remember being stuck with /query:
Do live databases support the /query endpoint? I wanted to use that to avoid hitting /execute (with the possibility of writes) entirely.
|
Yep, they do support the query end point. With that time it got stuck, how long ago was that? We were having backend problems with RabbitMQ a while ago, which completely wedged everything when it occurred. We replaced RabbitMQ (about a week ago), so if that's what you hit then you're probably ok to use Query calls again. 😄 |
Oh, why the avoidance of the Execute end point btw? Was that also getting stuck when you used it? |
@captn3m0 When you have a chance to try this stuff again, let me know if you come across any of the end points not working as expected. And I just realised that when you said "remember being stuck" that you were probably meaning "conceptually" rather than server problems. Heh. 😉 |
Database: https://dbhub.io/captn3m0/bbmp-2023.db
The database is public, and uses the GEOPOLY extension. The table was created using
CREATE VIRTUAL TABLE wards USING geopoly(No,Name)
.Query:
SELECT No FROM wards LIMIT 0,10
Running the query as a Visualization fails:
Running it over the API (
/v1/query
) results in the same response:The text was updated successfully, but these errors were encountered: