sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

[Discussion] Add `wasm32-wasip2` compilation target support to runtime dispatcher & wasi-socket support

Open Aditya1404Sal opened this issue 4 months ago • 0 comments

I have found these related issues/pull requests

latest WIP at : https://github.com/Aditya1404Sal/sqlx/tree/latest/wasip3 Wasip3 : https://crates.io/crates/wasip3 Early POC : https://github.com/rvolosatovs/sqlx/tree/feat/wasip3

Description

since Webassembly is almost close to releasing wasi-p3, it will intrduce native async and extended socket support, which will allow users to basically replace their runtime layer with wasi equivalents to directly compile their clients over to .wasm code, in fact a pre-release version of it's rust bindings are available here : https://crates.io/crates/wasip3

An early POC was created here : https://github.com/rvolosatovs/sqlx/tree/feat/wasip3 but since it was an early draft, it utilized some abstractions on the futures crates which will need to be migrated over to wit_bindgen primitives.

This is more of a discussion Item since wasip3 is still brand new and an official release is still underway.

Prefered solution

In our use case, we were hoping that the sqlx client could be compiled to a wasm32-wasip3 target enabling the direct use of mysql/postgres/sqlite sqlx drivers in webassembly components. Currently WIP at : https://github.com/Aditya1404Sal/sqlx/tree/latest/wasip3

Is this a breaking change? Why or why not?

Not a breaking change, Conditional compilation for a new target and feature flag shouldn't cause any breaking changes. Tokio and other runtimes expected to stay unaffected.

Aditya1404Sal avatar Oct 13 '25 18:10 Aditya1404Sal