Very interesting! I spent a long session in a harness the other day getting pglite to the point it would work reliably in a browser for a specific use case I had. The key was NOT using that environment to run the SQLx validation, but just having a real long running Postgres for local builds + CI, and simply creating and dropping a database for that run.
Used pglite-oxide for the Electron build and then we went off into the weeds and ported pglite so it could run in iOS for iOS apps. The easiest way to do this is to just do it as a plain old Mac app first and get it working there first.
I’ll open source this if I figure out if we can maintain it and document it.