Comment by michelpp
4 days ago
I think the right approach would be to store the sqlite database as a varlena type that can be TOASTed and then "expanded" using the Expanded Datum API so that it's a live open database connection for the life of the transaction:
https://www.postgresql.org/docs/17/xtypes.html#XTYPES-TOAST
https://github.com/postgres/postgres/blob/master/src/include...
Thanks i will look into this more, /tmp stuff is most definitely a hack.
Here's an example of a simple expanded object to start from:
https://github.com/michelp/pgexpanded