Pglite-fusion
lastmod 2024-11-20created 2024-11-202 edits
Embed an SQLite database in your PostgreSQL table. AKA multitenancy has been solved.
Embedding SQLite in PostgreSQL tables
About
- An extension that lets you embed an SQLite DB itself into a PostgreSQL table as an SQLITE column type. Solves multitenancy this way.
- Written with Rust + the Pgrx framework
Implementation details
- Stores the DB as a CBOR (Concise Binary Object Representation)-encoded Vec
- On query execution, it is created as a random file in the /tmp folder.
- SQLite loads the file, runs the query, and returns the result as a single-row table containing JSON-encoded values