Skip to content

Is wasm32-unknown-unknown currently a supported target for tokio-postgres? #1236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Jaltaire opened this issue Apr 26, 2025 · 2 comments
Open

Comments

@Jaltaire
Copy link

Jaltaire commented Apr 26, 2025

I see a couple other Issues reference wasm32-unknown-unknown support:

though I'm not seeing how this would work due to current mio/tokio limitations...? Indeed, trying to compile with cargo build --target wasm32-unknown-unknown yields a host of mio-related errors.

Mostly sanity checking here, as I would love to use tokio-postgres within an edge computing runtime if there is something I'm missing.

@sfackler
Copy link
Owner

You need to build it without the tokio integration and hook it up to some other API providing async TCP.

https://github.com/sfackler/rust-postgres/blob/master/.github/workflows/ci.yml#L75

@Jaltaire
Copy link
Author

Got it. As future reference for anyone who is looking, here's how this would be set up for Cloudflare Workers, for example:

I'm exploring setting this up with Supabase Edge Functions, but this remains a work in progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants