I’ve just got to the end of the (fantastic) tutorial, and rather than setting up authentication I’d like to deploy the site with a read-only SQLite backend, while continuing to edit the data locally.
Is that feasible with the way things are currently set up?
I don’t think this would work via Netlify because I don’t think the bundling package (zip-it-and-ship-it) would include the sqlite database.
Technically I don’t see why it wouldn’t work
I see that @peterp is replying to this at the same time, so hopefully I don’t negate everything he says!
Remember that, right now, Redwood is meant to be deployed to the JAMstack, which means there is no running server that could contain and persist your database. Everything from the database to file uploads needs to be hosted on a third party service.
I looked into some kind of cloud-based SQLite provider but didn’t find any. SQLite is really meant to be single-user, no concurrency, which isn’t ideal for the web. You can have multiple users connecting and performing
SELECTs but only one user can be making changes.
All that being said, you could always deploy Redwood a real, server-backed environment and do whatever you want with the database. If you get it work be sure to report your findings for everyone else!
I knew I was missing something - thanks, that makes sense.
Oh, boy, do I have a super hacky way you could try to do this. Caveats:
- I have no idea if this is a good idea
- I have no idea if this would actually work
Use different branches to a) deploy and b) for local content administration.
You’ll connect locally to your production dB for content administration. And for your deploy branch try something like:
- connect to a read-only replica dB (sounds expensive)
- create a read-only View table(s) that you only access from deployed (sounds hard… modify schema, or maybe possible via connection settings to have read only)
- disable admin capability/pages in the deploy (e.g. remove routes, but sketchy security)
Or just try Netlify Auth.
And/or maybe connect to Contentful for CMS (sooner or later someone is going to try this with Redwood).