Remove 'redis' integration from 'contrib'.

The latest version of 'redis' is async and implements its own connection
retrieval.
This commit is contained in:
Sergio Benitez 2020-07-21 15:09:44 -07:00
parent 9d4fea2937
commit 949b01cb9d
4 changed files with 0 additions and 26 deletions

View File

@ -35,7 +35,6 @@ diesel_mysql_pool = ["databases", "diesel/mysql", "diesel/r2d2"]
postgres_pool = ["databases", "postgres", "r2d2_postgres"]
mysql_pool = ["databases", "mysql", "r2d2_mysql"]
sqlite_pool = ["databases", "rusqlite", "r2d2_sqlite"]
redis_pool = ["databases", "redis", "r2d2_redis"]
memcache_pool = ["databases", "memcache", "r2d2-memcache"]
[dependencies]
@ -68,8 +67,6 @@ mysql = { version = "18.0", optional = true }
r2d2_mysql = { version = "18.0", optional = true }
rusqlite = { version = "0.23", optional = true }
r2d2_sqlite = { version = "0.16", optional = true }
redis = { version = "0.15", optional = true }
r2d2_redis = { version = "0.13", optional = true }
memcache = { version = "0.14", optional = true }
r2d2-memcache = { version = "0.5", optional = true }

View File

@ -345,18 +345,15 @@
//! | Postgres | [Rust-Postgres] | `0.17` | [`postgres::Client`] | `postgres_pool` |
//! | Sqlite | [Diesel] | `1` | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` |
//! | Sqlite | [`Rusqlite`] | `0.23` | [`rusqlite::Connection`] | `sqlite_pool` |
//! | Redis | [`redis-rs`] | `0.15` | [`redis::Connection`] | `redis_pool` |
//! | Memcache | [`memcache`] | `0.14` | [`memcache::Client`] | `memcache_pool` |
//!
//! [Diesel]: https://diesel.rs
//! [`redis::Connection`]: https://docs.rs/redis/0.15.0/redis/struct.Connection.html
//! [`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
//! [`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
//! [`redis-rs`]: https://github.com/mitsuhiko/redis-rs
//! [`Rusqlite`]: https://github.com/jgallagher/rusqlite
//! [Rust-Postgres]: https://github.com/sfackler/rust-postgres
//! [`rust-mysql-simple`]: https://github.com/blackbeam/rust-mysql-simple
@ -410,9 +407,6 @@ use self::r2d2::ManageConnection;
#[cfg(feature = "sqlite_pool")] pub extern crate rusqlite;
#[cfg(feature = "sqlite_pool")] pub extern crate r2d2_sqlite;
#[cfg(feature = "redis_pool")] pub extern crate redis;
#[cfg(feature = "redis_pool")] pub extern crate r2d2_redis;
#[cfg(feature = "memcache_pool")] pub extern crate memcache;
#[cfg(feature = "memcache_pool")] pub extern crate r2d2_memcache;
@ -614,7 +608,6 @@ impl<'a> Display for ConfigError {
/// * `postgres::Connection`
/// * `mysql::Conn`
/// * `rusqlite::Connection`
/// * `redis::Connection`
///
/// # Implementation Guide
///
@ -777,18 +770,6 @@ impl Poolable for rusqlite::Connection {
}
}
#[cfg(feature = "redis_pool")]
impl Poolable for redis::Connection {
type Manager = r2d2_redis::RedisConnectionManager;
type Error = DbError<redis::RedisError>;
fn pool(config: DatabaseConfig<'_>) -> Result<r2d2::Pool<Self::Manager>, Self::Error> {
let manager = r2d2_redis::RedisConnectionManager::new(config.url).map_err(DbError::Custom)?;
r2d2::Pool::builder().max_size(config.pool_size).build(manager)
.map_err(DbError::PoolError)
}
}
#[cfg(feature = "memcache_pool")]
impl Poolable for memcache::Client {
type Manager = r2d2_memcache::MemcacheConnectionManager;

View File

@ -75,7 +75,6 @@ if [ "$1" = "--contrib" ]; then
postgres_pool
mysql_pool
sqlite_pool
redis_pool
memcache_pool
brotli_compression
gzip_compression

View File

@ -235,19 +235,16 @@ Presently, Rocket provides built-in support for the following databases:
| Postgres | [Rust-Postgres] | `0.17` | [`postgres::Client`] | `postgres_pool` |
| Sqlite | [Diesel] | `1` | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` |
| Sqlite | [`Rusqlite`] | `0.23` | [`rusqlite::Connection`] | `sqlite_pool` |
| Redis | [`redis-rs`] | `0.15` | [`redis::Connection`] | `redis_pool` |
| Memcache | [`memcache`] | `0.14` | [`memcache::Client`] | `memcache_pool` |
[`r2d2`]: https://crates.io/crates/r2d2
[Diesel]: https://diesel.rs
[`redis::Connection`]: https://docs.rs/redis/0.15.0/redis/struct.Connection.html
[`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
[`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
[`redis-rs`]: https://github.com/mitsuhiko/redis-rs
[`Rusqlite`]: https://github.com/jgallagher/rusqlite
[Rust-Postgres]: https://github.com/sfackler/rust-postgres
[`rust-mysql-simple`]: https://github.com/blackbeam/rust-mysql-simple