mirror of https://github.com/rwf2/Rocket.git
Remove 'mongodb' integration from 'contrib'.
The latest version of 'mongodb' is async and implements its own internal connection pooling.
This commit is contained in:
parent
3a40d1071c
commit
9d4fea2937
|
@ -36,7 +36,6 @@ postgres_pool = ["databases", "postgres", "r2d2_postgres"]
|
||||||
mysql_pool = ["databases", "mysql", "r2d2_mysql"]
|
mysql_pool = ["databases", "mysql", "r2d2_mysql"]
|
||||||
sqlite_pool = ["databases", "rusqlite", "r2d2_sqlite"]
|
sqlite_pool = ["databases", "rusqlite", "r2d2_sqlite"]
|
||||||
redis_pool = ["databases", "redis", "r2d2_redis"]
|
redis_pool = ["databases", "redis", "r2d2_redis"]
|
||||||
mongodb_pool = ["databases", "mongodb", "r2d2-mongodb"]
|
|
||||||
memcache_pool = ["databases", "memcache", "r2d2-memcache"]
|
memcache_pool = ["databases", "memcache", "r2d2-memcache"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -71,8 +70,6 @@ rusqlite = { version = "0.23", optional = true }
|
||||||
r2d2_sqlite = { version = "0.16", optional = true }
|
r2d2_sqlite = { version = "0.16", optional = true }
|
||||||
redis = { version = "0.15", optional = true }
|
redis = { version = "0.15", optional = true }
|
||||||
r2d2_redis = { version = "0.13", optional = true }
|
r2d2_redis = { version = "0.13", optional = true }
|
||||||
mongodb = { version = "0.3.12", optional = true }
|
|
||||||
r2d2-mongodb = { version = "0.2.0", optional = true }
|
|
||||||
memcache = { version = "0.14", optional = true }
|
memcache = { version = "0.14", optional = true }
|
||||||
r2d2-memcache = { version = "0.5", optional = true }
|
r2d2-memcache = { version = "0.5", optional = true }
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,6 @@
|
||||||
//! | Sqlite | [Diesel] | `1` | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` |
|
//! | Sqlite | [Diesel] | `1` | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` |
|
||||||
//! | Sqlite | [`Rusqlite`] | `0.23` | [`rusqlite::Connection`] | `sqlite_pool` |
|
//! | Sqlite | [`Rusqlite`] | `0.23` | [`rusqlite::Connection`] | `sqlite_pool` |
|
||||||
//! | Redis | [`redis-rs`] | `0.15` | [`redis::Connection`] | `redis_pool` |
|
//! | Redis | [`redis-rs`] | `0.15` | [`redis::Connection`] | `redis_pool` |
|
||||||
//! | MongoDB | [`mongodb`] | `0.3.12` | [`mongodb::db::Database`] | `mongodb_pool` |
|
|
||||||
//! | Memcache | [`memcache`] | `0.14` | [`memcache::Client`] | `memcache_pool` |
|
//! | Memcache | [`memcache`] | `0.14` | [`memcache::Client`] | `memcache_pool` |
|
||||||
//!
|
//!
|
||||||
//! [Diesel]: https://diesel.rs
|
//! [Diesel]: https://diesel.rs
|
||||||
|
@ -362,8 +361,6 @@
|
||||||
//! [Rust-Postgres]: https://github.com/sfackler/rust-postgres
|
//! [Rust-Postgres]: https://github.com/sfackler/rust-postgres
|
||||||
//! [`rust-mysql-simple`]: https://github.com/blackbeam/rust-mysql-simple
|
//! [`rust-mysql-simple`]: https://github.com/blackbeam/rust-mysql-simple
|
||||||
//! [`diesel::PgConnection`]: http://docs.diesel.rs/diesel/pg/struct.PgConnection.html
|
//! [`diesel::PgConnection`]: http://docs.diesel.rs/diesel/pg/struct.PgConnection.html
|
||||||
//! [`mongodb`]: https://github.com/mongodb-labs/mongo-rust-driver-prototype
|
|
||||||
//! [`mongodb::db::Database`]: https://docs.rs/mongodb/0.3.12/mongodb/db/type.Database.html
|
|
||||||
//! [`memcache`]: https://github.com/aisk/rust-memcache
|
//! [`memcache`]: https://github.com/aisk/rust-memcache
|
||||||
//! [`memcache::Client`]: https://docs.rs/memcache/0.14/memcache/struct.Client.html
|
//! [`memcache::Client`]: https://docs.rs/memcache/0.14/memcache/struct.Client.html
|
||||||
//!
|
//!
|
||||||
|
@ -416,9 +413,6 @@ use self::r2d2::ManageConnection;
|
||||||
#[cfg(feature = "redis_pool")] pub extern crate redis;
|
#[cfg(feature = "redis_pool")] pub extern crate redis;
|
||||||
#[cfg(feature = "redis_pool")] pub extern crate r2d2_redis;
|
#[cfg(feature = "redis_pool")] pub extern crate r2d2_redis;
|
||||||
|
|
||||||
#[cfg(feature = "mongodb_pool")] pub extern crate mongodb;
|
|
||||||
#[cfg(feature = "mongodb_pool")] pub extern crate r2d2_mongodb;
|
|
||||||
|
|
||||||
#[cfg(feature = "memcache_pool")] pub extern crate memcache;
|
#[cfg(feature = "memcache_pool")] pub extern crate memcache;
|
||||||
#[cfg(feature = "memcache_pool")] pub extern crate r2d2_memcache;
|
#[cfg(feature = "memcache_pool")] pub extern crate r2d2_memcache;
|
||||||
|
|
||||||
|
@ -795,17 +789,6 @@ impl Poolable for redis::Connection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "mongodb_pool")]
|
|
||||||
impl Poolable for mongodb::db::Database {
|
|
||||||
type Manager = r2d2_mongodb::MongodbConnectionManager;
|
|
||||||
type Error = DbError<mongodb::Error>;
|
|
||||||
|
|
||||||
fn pool(config: DatabaseConfig<'_>) -> Result<r2d2::Pool<Self::Manager>, Self::Error> {
|
|
||||||
let manager = r2d2_mongodb::MongodbConnectionManager::new_with_uri(config.url).map_err(DbError::Custom)?;
|
|
||||||
r2d2::Pool::builder().max_size(config.pool_size).build(manager).map_err(DbError::PoolError)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "memcache_pool")]
|
#[cfg(feature = "memcache_pool")]
|
||||||
impl Poolable for memcache::Client {
|
impl Poolable for memcache::Client {
|
||||||
type Manager = r2d2_memcache::MemcacheConnectionManager;
|
type Manager = r2d2_memcache::MemcacheConnectionManager;
|
||||||
|
|
|
@ -76,7 +76,6 @@ if [ "$1" = "--contrib" ]; then
|
||||||
mysql_pool
|
mysql_pool
|
||||||
sqlite_pool
|
sqlite_pool
|
||||||
redis_pool
|
redis_pool
|
||||||
mongodb_pool
|
|
||||||
memcache_pool
|
memcache_pool
|
||||||
brotli_compression
|
brotli_compression
|
||||||
gzip_compression
|
gzip_compression
|
||||||
|
|
|
@ -236,7 +236,6 @@ Presently, Rocket provides built-in support for the following databases:
|
||||||
| Sqlite | [Diesel] | `1` | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` |
|
| Sqlite | [Diesel] | `1` | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` |
|
||||||
| Sqlite | [`Rusqlite`] | `0.23` | [`rusqlite::Connection`] | `sqlite_pool` |
|
| Sqlite | [`Rusqlite`] | `0.23` | [`rusqlite::Connection`] | `sqlite_pool` |
|
||||||
| Redis | [`redis-rs`] | `0.15` | [`redis::Connection`] | `redis_pool` |
|
| Redis | [`redis-rs`] | `0.15` | [`redis::Connection`] | `redis_pool` |
|
||||||
| MongoDB | [`mongodb`] | `0.3.12` | [`mongodb::db::Database`] | `mongodb_pool` |
|
|
||||||
| Memcache | [`memcache`] | `0.14` | [`memcache::Client`] | `memcache_pool` |
|
| Memcache | [`memcache`] | `0.14` | [`memcache::Client`] | `memcache_pool` |
|
||||||
|
|
||||||
[`r2d2`]: https://crates.io/crates/r2d2
|
[`r2d2`]: https://crates.io/crates/r2d2
|
||||||
|
@ -253,8 +252,6 @@ Presently, Rocket provides built-in support for the following databases:
|
||||||
[Rust-Postgres]: https://github.com/sfackler/rust-postgres
|
[Rust-Postgres]: https://github.com/sfackler/rust-postgres
|
||||||
[`rust-mysql-simple`]: https://github.com/blackbeam/rust-mysql-simple
|
[`rust-mysql-simple`]: https://github.com/blackbeam/rust-mysql-simple
|
||||||
[`diesel::PgConnection`]: http://docs.diesel.rs/diesel/pg/struct.PgConnection.html
|
[`diesel::PgConnection`]: http://docs.diesel.rs/diesel/pg/struct.PgConnection.html
|
||||||
[`mongodb`]: https://github.com/mongodb-labs/mongo-rust-driver-prototype
|
|
||||||
[`mongodb::db::Database`]: https://docs.rs/mongodb/0.3.12/mongodb/db/type.Database.html
|
|
||||||
[`memcache`]: https://github.com/aisk/rust-memcache
|
[`memcache`]: https://github.com/aisk/rust-memcache
|
||||||
[`memcache::Client`]: https://docs.rs/memcache/0.14/memcache/struct.Client.html
|
[`memcache::Client`]: https://docs.rs/memcache/0.14/memcache/struct.Client.html
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue