Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.

Update records in SQLite via SQL instead of re-creating the database/file - #12

Merged
tsibley merged 1 commit into
masterfrom
update-database-in-place-alternate
Jul 8, 2020
Merged

Update records in SQLite via SQL instead of re-creating the database/file#12
tsibley merged 1 commit into
masterfrom
update-database-in-place-alternate

Conversation

@tsibley

@tsibley tsibley commented Jul 8, 2020

Copy link
Copy Markdown
Member

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.

The new --truncate option to sqlite-utils insert is added in a PR I
submitted simonw/sqlite-utils#118. For now,
sqlite-utils is installed from our fork. When/if --truncate is released
officially, we can switch back to installing from PyPI.

Resolves #10.


Alternate to #11.

@tsibley

tsibley commented Jul 8, 2020

Copy link
Copy Markdown
Member Author

Well, that was fast: https://twitter.com/simonw/status/1280920409219555328 (or I was slow in merging this!)

I'll update this to use the official version instead of our fork.

…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.

The new --truncate option to `sqlite-utils insert` is added in
sqlite-utils 2.11, from a PR I submitted.¹

Resolves #10.

¹ simonw/sqlite-utils#118
@tsibley
tsibley force-pushed the update-database-in-place-alternate branch from 8f52e01 to d5bd474 Compare July 8, 2020 19:39
@tsibley
tsibley merged commit 52f9d12 into master Jul 8, 2020
@tsibley
tsibley deleted the update-database-in-place-alternate branch July 8, 2020 19:39
@tsibley

tsibley commented Jul 8, 2020

Copy link
Copy Markdown
Member Author

Deployed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deployed front-end doesn't reload to include latest data

2 participants