We do this with DuckDB, and leave the connection in read only mode, exposing the database over HTTP. SQL injection by design?
At a high level, we use DuckDB as an in-memory OLAP cache that’s invalidated via Postgres logical replication.
We compute a lot of derived data to offer a read-heavy workload as a product.
Possibly the most dubious choice I tried out recently was letting the front end just execute SQL directly against DuckDB with a thin serialization layer in the backend.
The best apart about it is the hot reload feedback loop. The backend doesn’t have to rebuild to iterate quickly.