-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update client.md for HTTPS in reqwest (#202)
* Update client.md for HTTPS in reqwest Signed-off-by: Michael Yuan <[email protected]> * Update my_sql_driver.md Signed-off-by: Michael Yuan <[email protected]> --------- Signed-off-by: Michael Yuan <[email protected]>
- Loading branch information
Showing
2 changed files
with
94 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ The database connection is necessary for today's enterprise development. WasmEdg | |
|
||
<!-- prettier-ignore --> | ||
:::note | ||
Before we start, ensure [you have Rust and WasmEdge installed](../setup.md). | ||
Before we start, ensure [you have Rust and WasmEdge installed](../setup.md). If you are connecting to a remote MySQL database using TLS, you will need to [install the TLS plugin](../../../start/install.md#tls-plug-in) for WasmEdge as well. | ||
::: | ||
|
||
## Run the example | ||
|
@@ -26,6 +26,19 @@ cargo build --target wasm32-wasi --release | |
wasmedge --env "DATABASE_URL=mysql://user:[email protected]:3306/mysql" target/wasm32-wasi/release/crud.wasm | ||
``` | ||
|
||
To use TLS, you will need to turn on the `default-rustls` feature in `Cargo.toml`. | ||
|
||
``` | ||
mysql_async_wasi = { version = "0.31", features = [ "default-rustls" ] } | ||
``` | ||
|
||
Then, run the application as follows. | ||
|
||
``` | ||
# Execute MySQL statements against an AWS RDS database that requires TLS | ||
wasmedge --env "DATABASE_SSL=1" --env "DATABASE_URL=mysql://user:[email protected]:3306/mysql" crud.wasm | ||
``` | ||
|
||
## Code explanation | ||
|
||
<!-- prettier-ignore --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters