-
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.
Mark the rustls plug-in as deprecated.
Signed-off-by: YiYing He <[email protected]>
- Loading branch information
Showing
6 changed files
with
28 additions
and
28 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
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 |
---|---|---|
|
@@ -39,7 +39,7 @@ wasmedge --env "DATABASE_SSL=1" --env "DATABASE_URL=mysql://user:[email protected] | |
In order to compile the `mysql_async` and `tokio` crates, we will need to apply two patches to add | ||
WasmEdge-specific socket APIs to those crates. The following example shows that the TLS connection is enabled. | ||
|
||
``` | ||
```toml | ||
[patch.crates-io] | ||
tokio = { git = "https://github.com/second-state/wasi_tokio.git", branch = "v1.36.x" } | ||
socket2 = { git = "https://github.com/second-state/socket2.git", branch = "v0.5.x" } | ||
|
@@ -57,7 +57,7 @@ statements. | |
|
||
Connect to a MySQL database. | ||
|
||
``` | ||
```rust | ||
// Below we create a customized connection pool | ||
let opts = Opts::from_url(&*get_url()).unwrap(); | ||
let mut builder = OptsBuilder::from_opts(opts); | ||
|
@@ -74,7 +74,7 @@ Connect to a MySQL database. | |
|
||
Create a table on the connected database. | ||
|
||
``` | ||
```rust | ||
// create table if no tables exist | ||
let result = r"SHOW TABLES LIKE 'orders';" | ||
.with(()) | ||
|
@@ -94,7 +94,7 @@ Create a table on the connected database. | |
|
||
Insert some records into the MySQL database using SQL. | ||
|
||
``` | ||
```rust | ||
let orders = vec![ | ||
Order::new(1, 12, 2, 56.0, 15.0, 2.0, String::from("Mataderos 2312")), | ||
Order::new(2, 15, 3, 256.0, 30.0, 16.0, String::from("1234 NW Bobcat")), | ||
|
@@ -122,7 +122,7 @@ Insert some records into the MySQL database using SQL. | |
|
||
Query the database. | ||
|
||
``` | ||
```rust | ||
// query data | ||
let loaded_orders = "SELECT * FROM orders" | ||
.with(()) | ||
|
@@ -147,8 +147,8 @@ Query the database. | |
|
||
Delete some records from the database. | ||
|
||
``` | ||
// // delete some data | ||
```rust | ||
// delete some data | ||
r"DELETE FROM orders WHERE order_id=4;" | ||
.ignore(&mut conn) | ||
.await?; | ||
|
@@ -177,8 +177,8 @@ Delete some records from the database. | |
|
||
Update records in the MySQL database. | ||
|
||
``` | ||
// // update some data | ||
```rust | ||
// update some data | ||
r"UPDATE orders | ||
SET shipping_address = '8366 Elizabeth St.' | ||
WHERE order_id = 2;" | ||
|
@@ -208,8 +208,7 @@ Update records in the MySQL database. | |
|
||
Close the database connection. | ||
|
||
``` | ||
```rust | ||
drop(conn); | ||
pool.disconnect().await.unwrap(); | ||
``` | ||
|
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
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
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
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