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.
ic-rusqlite
This is a convenience package to create a canister with the Sqlite support.
Prerequisites
It is assumed that you have rust, dfx.
To compile a project with this dependency, you will need to:
- install wasi2ic:
cargo install wasi2ic - install WASI target:
rustup target add wasm32-wasip1 - install WASI-SDK and WASI-oriented clang: WASI-SDK.
- Finally, set the
WASI_SDKandPATHvariables:
You can automate this by launching the preparation script:
|
Developing casniter
To enable rusqlite in your canister, add the helper dependency into your backend canister:
You will also need to update the dfx.json to specify path to wasm, set type to custom, and
specify custom build steps to enforce compilation to the wasm32-wasip1 target.
Finally, use wasi2ic to produce wasm executable on the Internet Computer.
Example:
Example use in your Rust code
Finally, use the with_connection() function to access your database:
//...
with_connection
//...
Further examples
You can find a small example in the "examples/backend" folder.
For more detailed explanations, see the ic-rusqlite book.