feat: support `wasm` environments for postgresql
This disables the home directory loading for WASM environments, as a filesystem to load files from is not available, as well as conditionally adding home on non WASM environments. With this, using sqlx-postgres is possible on wasm32-unknown-unknown targets.
I think there's actually quite a bit more work involved getting wasm32-unknown-unknown working properly after digging in a bit more -- I'll investigate in this PR when I have some more free time available 🕵️
Yeah, you also can't dial a TCP connection from normal Webassembly which unfortunately makes this a non-starter.
You'd have to compile for wasm32-wasi which is not a stable target IIRC and not supported in most WASM environments.
Yeah -- my original plan was to use sqlite in a WASM environment (with e.g. in-memory DB only) for little toy project but the SQLite bindings didn't play nice with wasm32-unknown-unknown (the C bindings don't compile properly for that target).
Forgetting TCP is a non-starter, I started poking at the sqlx-postgres crate a bit and the rest is history.
I'll close this PR out now. Thank you!