Skip to content

Instantly share code, notes, and snippets.

@tjmaynes
Created October 12, 2021 18:04
Show Gist options
  • Save tjmaynes/1954436d820be4440ab21cf6aac99c72 to your computer and use it in GitHub Desktop.
Save tjmaynes/1954436d820be4440ab21cf6aac99c72 to your computer and use it in GitHub Desktop.
...
let db_conn = PgPoolOptions::new()
.max_connections(5)
.connect_timeout(Duration::from_secs(2))
.connect(database_url.as_str()) // <- Use the str version of database_url variable.
.await
.expect("Should have created a database connection");
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment