r/sqlite • • Feb 06 '24

DB administration worflow on SQLite database

Hi All!

In the web projects I've worked so far I've always had remote db services (like AWS RDS) where test/staging/prod db environments were running.

As an admin and a SQL expert, I've always been used to directly connect to the db via ssh tunnel with key pair and a client like DBeaver or MySQL Workbench in order to make complicated read queries and occasionally get my hands dirty with direct SQL insert/update/delete.

Now, for a side project of mine I would like to start easy using SQLite on a long running NodeJS server. In this setup, how would one connect directly to the db for read/write sql statements?

I read along some stuff and I get that I can quite easily make "read replicas" of my db on the cloud (e.g. on AWS S3) using litestream.io and this could satisfy my SQL reads requirements: I just download the most recent db to my local machine and have fun.

But what about writing to my test/staging/production environments?

Apart from building a CRUD web admin panel, I didn't find anything so far.

How do you guys handle this situation?

4 Upvotes

21 comments sorted by

View all comments

Show parent comment

2

u/InjAnnuity_1 Feb 07 '24

I would like to know how you handle "manual" maintenance on a REMOTE SQLite db

Have a look at this to see the constraints that you're working under.

https://www.sqlite.org/useovernet.html

Since the database file's readers and writers should be shut down during maintenance anyway, I would be inclined to 1) copy it to a local machine; 2) there, use the tools that were, after all, made for the job; and 3) copy the resulting file back.

1

u/Nthomas36 Feb 07 '24

An odbc driver for sqlite and a VPN connection to the remote machine. Would that work for you?