WasmEdge / wasmedge-db-examples

Lightweight database clients in the WasmEdge Runtime
Apache License 2.0
64 stars 10 forks source link

Instantiation error when running mysql_async example #14

Closed sunng87 closed 10 months ago

sunng87 commented 10 months ago

I'm getting this error when running mysql_async example using wasmedge target/.... It has something to do with TLS as from the information.

❯ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `wasmedge target/wasm32-wasi/debug/crud.wasm`
[2023-11-14 02:55:33.510] [error] instantiation failed: unknown import, Code: 0x62
[2023-11-14 02:55:33.510] [error]     When linking module: "rustls_client" , function name: "new_codec"
[2023-11-14 02:55:33.510] [error]     At AST node: import description
[2023-11-14 02:55:33.510] [error]     At AST node: import section
[2023-11-14 02:55:33.510] [error]     At AST node: module
juntao commented 10 months ago

Sorry, the example demonstrate how to make a TLS connection to a remote database. You will need to install the WasmEdge TLS plugin to make it work.

Our installer still has an issue with the TLS plugin, but you can install by hand following the steps in the CI.

https://github.com/WasmEdge/wasmedge-db-examples/blob/main/.github/workflows/examples.yml

Lines 77-84 install WasmEdge with the TLS plugin

Thanks.

sunng87 commented 10 months ago

Thank you! I think we will need to update README for that.

juntao commented 10 months ago

Updated the README and the GitHub Action script.

You can now install WasmEdge and the TLS plugin in a single line.