mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-27 13:46:32 +00:00
wip(mysql): connect phase
This commit is contained in:
@@ -14,3 +14,5 @@ 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"] }
|
||||
log = "0.4"
|
||||
env_logger = "0.8.2"
|
||||
|
||||
@@ -1,35 +1,9 @@
|
||||
// #[async_std::main]
|
||||
// async fn main() -> anyhow::Result<()> {
|
||||
// let _stream = AsyncStd::connect_tcp("localhost", 5432).await?;
|
||||
//
|
||||
// Ok(())
|
||||
// }
|
||||
|
||||
use sqlx::mysql::MySqlConnectOptions;
|
||||
use sqlx::mysql::MySqlConnection;
|
||||
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?;
|
||||
let _conn = <MySqlConnection>::connect("mysql://root:password@localhost:3307/main").await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user