docs.rs failed to build diesel-wasm-sqlite-0.0.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Diesel Backend for SQLite and WASM
Use SQLite with Diesel ORM in your web apps!
Quickstart
add diesel-wasm-sqlite
to your project. SQLite is automatically bundled with
the library.
[]
= { = "2.2" }
= { = "https://github.com/xmtp/libxmtp", = "wasm-backend" }
= "0.2"
use ;
use *;
pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!;
// SQLite must be instantiated in a web-worker
// to take advantage of OPFS
async
look in tests/web.rs
for working example!
Development
Install yarn dependencies
yarn install
Build the SQLite/OPFS BUndle
yarn run build
Build the rust code, and re-build package.json
if it changed
cargo build --target wasm32-unknown-unknown
Run Tests
wasm-pack test --safari --features unsafe-debug-query
navigate to http://localhost:8000
to observe test output
Run Tests (headless)
wasm-pack test --safari --headless
Setting up the project in VSCode
rust-analyzer does not like crates with different targets in the same workspace.
If you want this to work well with your LSP, open diesel-wasm-sqlite
as it's
own project in VSCode.