mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
docs: tweak quickstart fix PR for review comments
This commit is contained in:
parent
3b80998801
commit
54011f1893
1 changed files with 6 additions and 2 deletions
|
@ -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…
Reference in a new issue