mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-02 15:25:32 +00:00
docs: tweak quickstart fix PR for review comments
This commit is contained in:
parent
3b80998801
commit
54011f1893
@ -172,7 +172,7 @@ sqlx = { version = "0.4.0", features = [ "runtime-async-std-native-tls" ] }
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
sqlx = { version = "0.4.0-beta.1", features = [ "postgres" ] }
|
||||
sqlx = { version = "0.4.1", features = [ "postgres" ] }
|
||||
async-std = { version = "1.6", features = [ "attributes" ] }
|
||||
```
|
||||
|
||||
@ -181,9 +181,13 @@ use sqlx::postgres::PgPoolOptions;
|
||||
// use sqlx::mysql::MySqlPoolOptions;
|
||||
// etc.
|
||||
|
||||
#[async_std::main] // or #[tokio::main]
|
||||
#[async_std::main]
|
||||
// or #[tokio::main]
|
||||
async fn main() -> Result<(), sqlx::Error> {
|
||||
// Create a connection pool
|
||||
// for MySQL, use MySqlPoolOptions::new()
|
||||
// for SQLite, use SqlitePoolOptions::new()
|
||||
// etc.
|
||||
let pool = PgPoolOptions::new()
|
||||
.max_connections(5)
|
||||
.connect("postgres://postgres:password@localhost/test").await?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user