uktrade / public-data-api

The source for the Department for International Trade's Public Data API
https://data.api.trade.gov.uk/
MIT License
5 stars 1 forks source link

build(deps): bump sqlite-s3-query and remove explicit transactions #210

Closed michalc closed 5 months ago

michalc commented 5 months ago

sqlite-s3-query 0.0.68 creates a new connection for every call to the query function. As a result, transactions do not persist between one call to the query function and the next, therefore it's incorrect to pass it 'ROLLBACK', because there is now never a transaction in progress: calling ROLLBACK causes a SQLite Logic Error.

In addition, the isolation provided by the transactions prior to this change is now given by the separate connections, so there isn't a need for transactions at all. So, we can and do remove them.

Note that for each new query function that's generated by sqlite-s3-query, even over multiple calls to it, it will always query the same version of the sqlite file in the s3 bucket. And so even if the sqlite file is replaced between multiple calls to query, this change doesn't introduce inconsistency issues.