Update records in SQLite via SQL instead of re-creating the database/file - #11
Update records in SQLite via SQL instead of re-creating the database/file#11tsibley wants to merge 1 commit into
Conversation
…file This moves the update from the filesystem layer into the SQL layer, thus allowing multiple processes to coordinate. Datasette holds open SQLite connections and was keeping references to the deleted files. Since the Makefile recipe got more complicated, move it to a shell script. Resolves #10.
|
Since I fixed the Either implementation is totally fine by me but wanted to put both out there. |
| # room for an empty table after a successful delete but failed insert. | ||
| # -trs, 7 July 2020 | ||
| if [[ -e "$database" ]]; then | ||
| # sqlite3 appears to exits non-zero on a SQL error only when the SQL |
ghost
left a comment
There was a problem hiding this comment.
See the tiny typo and a question about confirming that the DELETE worked.
Given that you fixed the |
joverlee521
left a comment
There was a problem hiding this comment.
I prefer the sqlite-utils --truncate solution. Sounds like they are open to making improvements to how they handle transactions 👍
|
Closing this in favor of #12 then. Thanks for all your comments and our group programming yesterday! |
This moves the update from the filesystem layer into the SQL layer, thus
allowing multiple processes to coordinate. Datasette holds open SQLite
connections and was keeping references to the deleted files.
Since the Makefile recipe got more complicated, move it to a shell
script.
Resolves #10.