docs: add some module-level information sqlx::database

This commit is contained in:
Ryan Leckey
2020-07-18 03:13:41 -07:00
parent f345c23e51
commit 9029a345e5
2 changed files with 62 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
//! Generic database driver with the specific driver selected at runtime.
#[macro_use]
mod decode;

View File

@@ -1,4 +1,60 @@
//! Traits to represent various database drivers.
//! Traits to represent a database driver.
//!
//! # Support
//!
//! ## Tier 1
//!
//! Tier 1 support can be thought of as "guaranteed to work". Automated testing is setup to
//! ensure a high level of stability and functionality.
//!
//! | Database | Version | Driver |
//! | - | - | - |
//! | [MariaDB] | 10.1+ | [`mysql`] |
//! | [Microsoft SQL Server] | 2019 | [`mssql`] |
//! | [MySQL] | 5.6, 5.7, 8.0 | [`mysql`] |
//! | [PostgreSQL] | 9.5+ | [`postgres`] |
//! | [SQLite] | 3.20.1+ | [`sqlite`] |
//!
//! [MariaDB]: https://mariadb.com/
//! [MySQL]: https://www.mysql.com/
//! [Microsoft SQL Server]: https://www.microsoft.com/en-us/sql-server
//! [PostgreSQL]: https://www.postgresql.org/
//! [SQLite]: https://www.sqlite.org/
//!
//! [`mysql`]: ../sqlite/index.html
//! [`postgres`]: ../postgres/index.html
//! [`mssql`]: ../mssql/index.html
//! [`sqlite`]: ../sqlite/index.html
//!
//! ## Tier 2
//!
//! Tier 2 support can be thought as "should work". No specific automated testing is done,
//! at this time, but there are efforts to ensure compatibility. Tier 2 support also includes
//! database distributions that provide protocols that closely match a database from Tier 1.
//!
//! _No databases are in tier 2 at this time._
//!
//! # `Any`
//!
//! Selecting a database driver is, by default, a compile-time decision. SQLx is designed this way
//! to take full advantage of the performance and type safety made available by Rust.
//!
//! We recognize that you may wish to make a runtime decision to decide the database driver. The
//! [`Any`] driver is provided for that purpose.
//!
//! ## Example
//!
//! ```rust,ignore
//! // connect to SQLite
//! let conn = AnyConnection::connect("sqlite://file.db").await?;
//!
//! // connect to Postgres, no code change
//! // required, decided by the scheme of the URI
//! let conn = AnyConnection::connect("postgres://localhost/sqlx").await?;
//! ```
//!
//! [`Any`]: ../any/index.html
//!
use std::fmt::Debug;
@@ -82,4 +138,7 @@ pub trait HasArguments<'q> {
type ArgumentBuffer;
}
/// A [`Database`] that maintains a client-side cache of prepared statements.
///
/// [`Database`]: trait.Database.html
pub trait HasStatementCache {}