Rocket

A web framework for Rust. https://rocket.rs (mirror)
git clone git://git.thc420.xyz/Rocket
Log | Files | Refs | README

commit fc78eaf8363f1d3346ed9f51a6168f4b55152e8a
parent da7e022f990e0b8e8201b0a359a43104686ff1a4
Author: Jeb Rosen <jeb@jebrosen.com>
Date:   Mon, 27 May 2019 10:43:15 -0700

Document contrib database library versions.

This commit also adds a note to the contrib database documentation
describing how to enable features in upstream database crates.

Diffstat:
Mcontrib/lib/src/databases.rs | 25+++++++++++++------------
Msite/guide/6-state.md | 34++++++++++++++++++++++------------
2 files changed, 35 insertions(+), 24 deletions(-)

diff --git a/contrib/lib/src/databases.rs b/contrib/lib/src/databases.rs @@ -345,18 +345,19 @@ //! The list below includes all presently supported database adapters and their //! corresponding [`Poolable`] type. //! -//! | Kind | Driver | `Poolable` Type | Feature | -//! |----------|-----------------------|--------------------------------|------------------------| -//! | MySQL | [Diesel] | [`diesel::MysqlConnection`] | `diesel_mysql_pool` | -//! | MySQL | [`rust-mysql-simple`] | [`mysql::Conn`] | `mysql_pool` | -//! | Postgres | [Diesel] | [`diesel::PgConnection`] | `diesel_postgres_pool` | -//! | Postgres | [Rust-Postgres] | [`postgres::Connection`] | `postgres_pool` | -//! | Sqlite | [Diesel] | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` | -//! | Sqlite | [Rustqlite] | [`rusqlite::Connection`] | `sqlite_pool` | -//! | Neo4j | [`rusted_cypher`] | [`rusted_cypher::GraphClient`] | `cypher_pool` | -//! | Redis | [`redis-rs`] | [`redis::Connection`] | `redis_pool` | -//! | MongoDB | [`mongodb`] | [`mongodb::db::Database`] | `mongodb_pool` | -//! | Memcache | [`memcache`] | [`memcache::Client`] | `memcache_pool` | +// Note: Keep this table in sync with site/guite/6-state.md +//! | Kind | Driver | Version | `Poolable` Type | Feature | +//! |----------|-----------------------|-----------|--------------------------------|------------------------| +//! | MySQL | [Diesel] | `1` | [`diesel::MysqlConnection`] | `diesel_mysql_pool` | +//! | MySQL | [`rust-mysql-simple`] | `16` | [`mysql::conn`] | `mysql_pool` | +//! | Postgres | [Diesel] | `1` | [`diesel::PgConnection`] | `diesel_postgres_pool` | +//! | Postgres | [Rust-Postgres] | `0.15` | [`postgres::Connection`] | `postgres_pool` | +//! | Sqlite | [Diesel] | `1` | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` | +//! | Sqlite | [`Rustqlite`] | `0.16` | [`rusqlite::Connection`] | `sqlite_pool` | +//! | Neo4j | [`rusted_cypher`] | `1` | [`rusted_cypher::GraphClient`] | `cypher_pool` | +//! | Redis | [`redis-rs`] | `0.10` | [`redis::Connection`] | `redis_pool` | +//! | MongoDB | [`mongodb`] | `0.3.12` | [`mongodb::db::Database`] | `mongodb_pool` | +//! | Memcache | [`memcache`] | `0.11` | [`memcache::Client`] | `memcache_pool` | //! //! [Diesel]: https://diesel.rs //! [`redis::Connection`]: https://docs.rs/redis/0.9.0/redis/struct.Connection.html diff --git a/site/guide/6-state.md b/site/guide/6-state.md @@ -177,18 +177,19 @@ three simple steps: Presently, Rocket provides built-in support for the following databases: -| Kind | Driver | `Poolable` Type | Feature | -|----------|-----------------------|--------------------------------|------------------------| -| MySQL | [Diesel] | [`diesel::MysqlConnection`] | `diesel_mysql_pool` | -| MySQL | [`rust-mysql-simple`] | [`mysql::conn`] | `mysql_pool` | -| Postgres | [Diesel] | [`diesel::PgConnection`] | `diesel_postgres_pool` | -| Postgres | [Rust-Postgres] | [`postgres::Connection`] | `postgres_pool` | -| Sqlite | [Diesel] | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` | -| Sqlite | [`Rustqlite`] | [`rusqlite::Connection`] | `sqlite_pool` | -| Neo4j | [`rusted_cypher`] | [`rusted_cypher::GraphClient`] | `cypher_pool` | -| Redis | [`redis-rs`] | [`redis::Connection`] | `redis_pool` | -| MongoDB | [`mongodb`] | [`mongodb::db::Database`] | `mongodb_pool` | -| Memcache | [`memcache`] | [`memcache::Client`] | `memcache_pool` | +<!-- Note: Keep this table in sync with contrib/lib/src/databases.rs --> +| Kind | Driver | Version | `Poolable` Type | Feature | +|----------|-----------------------|-----------|--------------------------------|------------------------| +| MySQL | [Diesel] | `1` | [`diesel::MysqlConnection`] | `diesel_mysql_pool` | +| MySQL | [`rust-mysql-simple`] | `16` | [`mysql::conn`] | `mysql_pool` | +| Postgres | [Diesel] | `1` | [`diesel::PgConnection`] | `diesel_postgres_pool` | +| Postgres | [Rust-Postgres] | `0.15` | [`postgres::Connection`] | `postgres_pool` | +| Sqlite | [Diesel] | `1` | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` | +| Sqlite | [`Rustqlite`] | `0.16` | [`rusqlite::Connection`] | `sqlite_pool` | +| Neo4j | [`rusted_cypher`] | `1` | [`rusted_cypher::GraphClient`] | `cypher_pool` | +| Redis | [`redis-rs`] | `0.10` | [`redis::Connection`] | `redis_pool` | +| MongoDB | [`mongodb`] | `0.3.12` | [`mongodb::db::Database`] | `mongodb_pool` | +| Memcache | [`memcache`] | `0.11` | [`memcache::Client`] | `memcache_pool` | [`r2d2`]: https://crates.io/crates/r2d2 [Diesel]: https://diesel.rs @@ -266,6 +267,15 @@ fn get_logs(conn: LogsDbConn, id: usize) -> Result<Logs> { } ``` +If your application uses features of a database engine that are not available +by default, for example support for `chrono` or `uuid`, you may enable those +features by adding them in `Cargo.toml` like so: + +```toml +[dependencies] +postgres = { version = "0.15", features = ["with-chrono"] } +``` + For more on Rocket's built-in database support, see the [`rocket_contrib::databases`] module documentation.