Best practices for incremental updates after datasette publish fly
?
#2017
-
I have a sqlite database in low GB size and the command The data is in csv format and I used Would this approach work okay? Any alternatives or better ways to do it?
Appreciate any feedback on this before I jump into a solution. I'm happy to share the exact steps once it's working. Or if anyone knows of a good writeup please let me know too, I searched but couldn't find one. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Thinking about this some more, it may be nice if Something like this:
Or, can the
|
Beta Was this translation helpful? Give feedback.
-
I think a wrinkle is that when you do The proposals you have sound like interesting things, but I think there's nothing quite like that yet. So, what can you do? One solution might look something like this:
I think you can achieve (2) in either of two ways: Option A: ssh to your Fly instance. The default docker image will likely be missing a bunch of tools, but you can apt-get install them. Install everything you need to run csvs-to-sqlite. Fetch your file. Run csvs-to-sqlite. Option B: Add They both feel a little bit Rube Goldberg-y, so it's a matter of taste. Option A will be a pain because the default docker image is missing a bunch of tools. Option B is a pain because you have to write some code. If it were me, I'd probably take a stab at doing option B -- you could prototype it all locally. |
Beta Was this translation helpful? Give feedback.
I think a wrinkle is that when you do
datasette publish fly database.db
, you're bakingdatabase.db
into the docker image, so it's not meant to be modified.The proposals you have sound like interesting things, but I think there's nothing quite like that yet.
So, what can you do?
One solution might look something like this:
Use Fly's persistent volumes to get a place where your DB can live and persist between deploys. https://simonwillison.net/2022/Sep/5/laion-aesthetics-weeknotes/ documents how to do this, scroll down to "Deploying it to Fly"
Figure out a way to run csvs-to-sqlite on your fly instance.
I think you can achieve (2) in either of two ways:
Option A: ssh to your Fly inst…