Yes, PostreSQL is like the javascript of databases.
I don't believe that nobody has ever done this... And google delivers: https://github.com/wasmerio/wasmer-postgres
That's where Worse is better idiom [1], again, unfortunately shines: The world is not built on top of elegancy, but by brutality (in the same sense as brtualism architecture, not bloodlust) and rapidness.
[0]: https://web.archive.org/web/20170119021049/http://www.defsta...