Repository: rwf2/Rocket (language: rust)

Issue:
Update Postgres dependency
Hello team,

Do you have a plan/desire to update the `postgres` crate? The `0.19.0` release uses tokio 1.0.

Happy to submit a PR, but I think it also means upgrading `r2d2_postgres` and I'm unsure about the implications.

Best
Knut


Discussion / hints:
Yes, we should make sure to do this before 0.5. FWIW it shouldn't matter *too* much which tokio release it uses aside from reducing extraneous dependencies on older versions, since this refers to the non-`async` `postgres` library that creates its own separate runtime.

Fix patch:
diff --git a/contrib/lib/Cargo.toml b/contrib/lib/Cargo.toml
index 2a92b907ab..19604d5570 100644
--- a/contrib/lib/Cargo.toml
+++ b/contrib/lib/Cargo.toml
@@ -64,9 +64,9 @@ uuid = { version = ">=0.7.0, <0.9.0", optional = true }
 
 # Database dependencies
 diesel = { version = "1.0", default-features = false, optional = true }
-postgres = { version = "0.17", optional = true }
+postgres = { version = "0.19", optional = true }
 r2d2 = { version = "0.8", optional = true }
-r2d2_postgres = { version = "0.16", optional = true }
+r2d2_postgres = { version = "0.18", optional = true }
 mysql = { version = "18.0", optional = true }
 r2d2_mysql = { version = "18.0", optional = true }
 rusqlite = { version = "0.23", optional = true }
diff --git a/contrib/lib/src/databases.rs b/contrib/lib/src/databases.rs
index 5a4d7ab20d..eddbdfc531 100644
--- a/contrib/lib/src/databases.rs
+++ b/contrib/lib/src/databases.rs
@@ -322,7 +322,7 @@
 //! | MySQL    | [Diesel]              | `1`       | [`diesel::MysqlConnection`]    | `diesel_mysql_pool`    |
 //! | MySQL    | [`rust-mysql-simple`] | `18`      | [`mysql::Conn`]                | `mysql_pool`           |
 //! | Postgres | [Diesel]              | `1`       | [`diesel::PgConnection`]       | `diesel_postgres_pool` |
-//! | Postgres | [Rust-Postgres]       | `0.17`    | [`postgres::Client`]           | `postgres_pool`        |
+//! | Postgres | [Rust-Postgres]       | `0.19`    | [`postgres::Client`]           | `postgres_pool`        |
 //! | Sqlite   | [Diesel]              | `1`       | [`diesel::SqliteConnection`]   | `diesel_sqlite_pool`   |
 //! | Sqlite   | [`Rusqlite`]          | `0.23`    | [`rusqlite::Connection`]       | `sqlite_pool`          |
 //! | Memcache | [`memcache`]          | `0.15`    | [`memcache::Client`]           | `memcache_pool`        |
@@ -330,7 +330,7 @@
 //! [Diesel]: https://diesel.rs
 //! [`rusqlite::Connection`]: https://docs.rs/rusqlite/0.23.0/rusqlite/struct.Connection.html
 //! [`diesel::SqliteConnection`]: http://docs.diesel.rs/diesel/prelude/struct.SqliteConnection.html
-//! [`postgres::Client`]: https://docs.rs/postgres/0.17/postgres/struct.Client.html
+//! [`postgres::Client`]: https://docs.rs/postgres/0.19/postgres/struct.Client.html
 //! [`diesel::PgConnection`]: http://docs.diesel.rs/diesel/pg/struct.PgConnection.html
 //! [`mysql::Conn`]: https://docs.rs/mysql/18/mysql/struct.Conn.html
 //! [`diesel::MysqlConnection`]: http://docs.diesel.rs/diesel/mysql/struct.MysqlConnection.html
diff --git a/site/guide/6-state.md b/site/guide/6-state.md
index c2ea5aad75..85e388b756 100644
--- a/site/guide/6-state.md
+++ b/site/guide/6-state.md
@@ -231,7 +231,7 @@ Presently, Rocket provides built-in support for the following databases:
 | MySQL    | [Diesel]              | `1`       | [`diesel::MysqlConnection`]    | `diesel_mysql_pool`    |
 | MySQL    | [`rust-mysql-simple`] | `18`      | [`mysql::Conn`]                | `mysql_pool`           |
 | Postgres | [Diesel]              | `1`       | [`diesel::PgConnection`]       | `diesel_postgres_pool` |
-| Postgres | [Rust-Postgres]       | `0.17`    | [`postgres::Client`]           | `postgres_pool`        |
+| Postgres | [Rust-Postgres]       | `0.19`    | [`postgres::Client`]           | `postgres_pool`        |
 | Sqlite   | [Diesel]              | `1`       | [`diesel::SqliteConnection`]   | `diesel_sqlite_pool`   |
 | Sqlite   | [`Rusqlite`]          | `0.23`    | [`rusqlite::Connection`]       | `sqlite_pool`          |
 | Memcache | [`memcache`]          | `0.15`    | [`memcache::Client`]           | `memcache_pool`        |
@@ -240,7 +240,7 @@ Presently, Rocket provides built-in support for the following databases:
 [Diesel]: https://diesel.rs
 [`rusqlite::Connection`]: https://docs.rs/rusqlite/0.23.0/rusqlite/struct.Connection.html
 [`diesel::SqliteConnection`]: https://docs.diesel.rs/diesel/prelude/struct.SqliteConnection.html
-[`postgres::Client`]: https://docs.rs/postgres/0.17/postgres/struct.Client.html
+[`postgres::Client`]: https://docs.rs/postgres/0.19/postgres/struct.Client.html
 [`diesel::PgConnection`]: https://docs.diesel.rs/diesel/pg/struct.PgConnection.html
 [`mysql::Conn`]: https://docs.rs/mysql/18/mysql/struct.Conn.html
 [`diesel::MysqlConnection`]: https://docs.diesel.rs/diesel/mysql/struct.MysqlConnection.html


Test patch: