4 ms·
I'm so interested to hear about the HTTP requests stuff. I've played a tiny bit with SQLite Python extensions that perform HTTP requests, but I'm very unsure o
by simonw 4y ago
I'm so interested to hear about the HTTP requests stuff.
I've played a tiny bit with SQLite Python extensions that perform HTTP requests, but I'm very unsure of the implications of this kind of thing.
What happens to the rest of the SQLite query engine if your custom function hits a page like https://httpbin.org/delay/10 https://httpbin.org/delay/10 with a deliberate 10 second delay before the request returns?
Maybe this is fine - your transaction takes 10 seconds longer but everything else continues to work as normal. I've not done the work to figure that out.
- alexgarcia-xyz 4y agoYup, if it hits https://httpbin.org/delay/10 https://httpbin.org/delay/10 then the entire script will delay for 10 seconds (unless you have a custom lower timeout setting). Which means you can only make HTTP requests in serial requests, which sucks, but much simpler than coordinating with other tools It'll come out in a week, but lmk if you want to play with it beforehand!
- simonw 4y agoHow will it affect other SQLite connections against the same database? My guess is they'll be OK, but presumably any transactions will lock tables for the duration?
- alexgarcia-xyz 4y agoI think you're right, tho not an expert with multiple connections. I think if the DB is in WAL mode and you're only issuing read-only requests, then there will be no lock and long HTTP requests won't lock anything up. But if you issue a write-request that locks tables, then other write-requests will be blocked with long requests. But if you're in journal mode then there's not much you can do. Please correct me if I'm wrong!