wip(mysql): connection/establish, WriteExt, BufExt, and settle on AsyncRuntime

This commit is contained in:
Ryan Leckey
2021-01-01 12:28:48 -08:00
parent 44c175bb19
commit 55a8e7ba29
39 changed files with 4693 additions and 156 deletions

2188
examples/quickstart/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
[package]
name = "sqlx-example-quickstart"
version = "0.0.0"
license = "MIT OR Apache-2.0"
edition = "2018"
authors = [
"LaunchBadge <contact@launchbadge.com>"
]
[dependencies]
actix-web = "3.3.2"
anyhow = "1.0.36"
async-std = { version = "1.8.0", features = ["attributes"] }
#sqlx = { path = "../../sqlx", features = ["tokio", "mysql", "blocking", "async-std", "actix"] }
sqlx = { path = "../../sqlx", features = ["tokio", "mysql"] }
tokio = { version = "1.0.1", features = ["rt", "rt-multi-thread", "macros"] }

View File

@@ -0,0 +1,35 @@
// #[async_std::main]
// async fn main() -> anyhow::Result<()> {
// let _stream = AsyncStd::connect_tcp("localhost", 5432).await?;
//
// Ok(())
// }
use sqlx::mysql::MySqlConnectOptions;
use sqlx::prelude::*;
// #[tokio::main]
// async fn main() -> anyhow::Result<()> {
// let mut conn = <MySqlConnection>::connect("mysql://").await?;
//
// Ok(())
// }
//
// #[async_std::main]
// async fn main() -> anyhow::Result<()> {
// let mut conn = <MySqlConnection>::builder()
// .host("loca%x91lhost")
// .port(20)
// .connect()
// .await?;
//
// Ok(())
// }
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut conn = <MySqlConnectOptions>::new().host("localhost").port(3306).connect().await?;
Ok(())
}