Wasm bindgen interface? #75
Replies: 1 comment 1 reply
-
Hey, one possibility is connecting to PGlite at the Postgres wire protocol layer, that way you will receive the raw byte arrays that can then be parsed directly to Rust types. That would remove the overhead of going Postgres types -> JS types -> Rust types, JS code would only be for connecting the parts and the type conversion becomes Postgres types -> Rust types. It's also likely you would want to run PGlite in a separate worker to your main Rust code so you're not blocking it, with that you would be operating at the JS layer anyway. We have an I've not looked, but I'm sure there will be a rust crate that contain the parts needed for constructing and parsing Postgres wire protocol messages. |
Beta Was this translation helpful? Give feedback.
-
We've had this discussion in other database-in-the-browser projects (see rhashimoto/wa-sqlite#154), but I am wondering if anyone has any thoughts about having the database wasm be directly interoperable with a Wasm_bindgen-based Rust codebase.
There are a few ways that this might be done:
wasm32-unknown-emscripten
target for their own codebases, which is really painfulAnyone have any thoughts on how one might go about this?
Beta Was this translation helpful? Give feedback.
All reactions