sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

SQLite-for-WASM with SQLx

Open Ekleog opened this issue 1 year ago • 2 comments

Hey! To the best of my knowledge, SQLx currently does not support wasm32-unknown-unknown in any way.

I noticed SQLite will soon get support for WASM.

I'm curious, is there interest on the SQLx side to get SQLite-for-WASM to work as a "native" backend of SQLx?

I'm asking ahead-of-time, because most often WASM ends up being quite an intrusive addition, eg. with basically no JsValue being Send.

Ekleog avatar Jan 13 '24 01:01 Ekleog

I'm also interested in using SQLx in wasm32-unknown-unknown!

ilbertt avatar Jan 10 '25 23:01 ilbertt

FWIW there is a sqlite crate for rust, with a native rust VFS: https://github.com/Spxg/sqlite-wasm-rs/

SQLX could be potentially interesting here, since it can contribute a rust-native async vfs, maybe based on one of these? https://github.com/rhashimoto/wa-sqlite/tree/master/src/examples#vfs-comparison

insipx avatar Jun 13 '25 20:06 insipx

It is not difficult to implement, but due to the lack of testing, it is not clear whether all functions work properly.

Image Image

Spxg avatar Jul 05 '25 04:07 Spxg