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.
The WASI preview1 target for Rust will be used:
You need the Wasm-oriented clang installation.
Once installed the clang compiler should be available from the path /opt/wasi-sdk/bin/.
If your WASI installation is in a different folder, assign it to environment variable WASI_SDK:
You will also need to make sure the clang is found and WASI_SYSROOT is specified:
Finally, install the wasi2ic tool:
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 get_connection() function to access your database:
//...
// get connection to the database
let conn = get_connection;
conn.execute?;
let data: = None;
conn.execute?;
//...
You can find a small example in the "examples/backend" folder.