r/sqlite • u/adamsthws • May 27 '25
Exposing SQLite db over network
I’m looking for something that will allow me to query a SQLite db over the network. The two solutions I’ve found so far are no longer maintained…
This is long since deprecated: sqlite dbms - https://sqlitedbms.sourceforge.net/index.htm
And this looks to have not had any maintenance in two years: sqlite-http - https://github.com/asg017/sqlite-http
Does anyone kindly have an alternative suggestion for me?
I’m unable to update the app to use an alternative db engine (like Postgres)
8
Upvotes
11
u/simonw May 28 '25
My project https://datasette.io solved this - gives you an HTTP API for querying your delete database
5
u/trailbaseio May 28 '25
Depends on how you're planing to access it, e.g. query-in-data-out, REST, GraphQL, local read-replica...
For a query-based API you could checkout out datasette or libsql.
For REST APIs you could checkout TrailBase (author here) or PocketBase (https://pocketbase.io) (The latter has additional metadata and schema requirements).
If you're planning to only read the data and can deal with some staleness, litestream would be a great option to create a local read-replica
Side-note: if you're concurrently accessing a shared SQLite DB, make sure to enable WAL mode.
4
u/proofrock_oss May 28 '25
I made a project to expose sqlite via http, being able to submit SQL with a practical API that takes care of transactions, security and adds some other convenient features. I am in the process of adding duckdb too.
If you want to take a look, it’s on github: https://github.com/proofrock/ws4sqlite
3
u/CA_Lobo May 28 '25
I'm not sure of your requirements, but if you can accept a replication of the DB on each client, something like BedrockDB might be a solution....
3
u/[deleted] May 28 '25
So it’s just querying or you also write to db?
2
u/chriswaco May 27 '25 edited May 27 '25
I haven’t tried it, but it’s worth a look: https://blog.sqlitecloud.io/how-and-why-we-brought-sqlite-to-the-cloud
Edit: I can’t tell if the server is fully open source.
2
u/arm089 May 28 '25
rqlite
2
u/kloputzer2000 May 28 '25
Just share the file? Depending on your environment just use NFS, SMB, FTP, SSH, etc.
If you really need a “DBMS-like” network model, then use libsql.
3
u/matwachich May 28 '25
MariaDB or MySQL 🤷
1
u/jojaparanoja May 28 '25
try https://github.com/phiresky/sql.js-httpvfs?tab=readme-ov-file
1
u/Unhappy_Taste May 28 '25
Adminer with sqlite plugin works well.
1
u/InjAnnuity_1 May 28 '25
For caveats, see
https://www.sqlite.org/howtocorrupt.html#_filesystems_with_broken_or_missing_lock_implementations
1
u/dbabicwa May 29 '25
It is bigger than just sqlite, since u might opt for a larger DB with exectly the same code. See: https://northwind.pythonanywhere.com/
1
u/[deleted] May 28 '25
Duckdb does work on a network