add more documentation

This commit is contained in:
Ryan Leckey 2020-03-18 22:46:34 -07:00
parent c2dee0cf5a
commit 2a8906d1e5
8 changed files with 13 additions and 3 deletions

View File

@ -24,6 +24,7 @@ mod types;
mod util;
/// An alias for [`Pool`], specialized for **MySQL**.
#[cfg_attr(docsrs, doc(cfg(feature = "mysql")))]
pub type MySqlPool = crate::pool::Pool<MySqlConnection>;
make_query_as!(MySqlQueryAs, MySql, MySqlRow);

View File

@ -16,7 +16,7 @@ use crate::postgres::stream::PgStream;
use crate::postgres::{sasl, tls};
use crate::url::Url;
/// An asynchronous connection to a [Postgres][super::Postgres] database.
/// An asynchronous connection to a [Postgres](struct.Postgres.html) database.
///
/// The connection string expected by [Connect::connect] should be a PostgreSQL connection
/// string, as documented at

View File

@ -1,3 +1,5 @@
//! Types which represent various database drivers.
use crate::database::{Database, HasCursor, HasRawValue, HasRow};
use crate::postgres::row::PgValue;

View File

@ -24,6 +24,7 @@ mod tls;
pub mod types;
/// An alias for [`Pool`][crate::Pool], specialized for **Postgres**.
#[cfg_attr(docsrs, doc(cfg(feature = "postgres")))]
pub type PgPool = crate::pool::Pool<PgConnection>;
make_query_as!(PgQueryAs, Postgres, PgRow);

View File

@ -2,4 +2,4 @@ mod numeric;
mod record;
pub use numeric::{PgNumeric, PgNumericSign};
pub use record::{PgRecordEncoder, PgRecordDecoder};
pub use record::{PgRecordDecoder, PgRecordEncoder};

View File

@ -22,7 +22,7 @@ use crate::url::Url;
#[derive(Clone, Copy)]
pub(super) struct SqliteConnectionHandle(pub(super) NonNull<sqlite3>);
/// A connection to a [SQLite][super::Sqlite] database.
/// A connection to a [Sqlite](struct.Sqlite.html) database.
pub struct SqliteConnection {
pub(super) handle: SqliteConnectionHandle,
pub(super) worker: Worker,

View File

@ -1,3 +1,5 @@
//! **SQLite** database and connection types.
mod arguments;
mod connection;
mod cursor;
@ -20,6 +22,7 @@ pub use types::SqliteTypeInfo;
pub use value::SqliteValue;
/// An alias for [`Pool`][crate::Pool], specialized for **Sqlite**.
#[cfg_attr(docsrs, doc(cfg(feature = "sqlite")))]
pub type SqlitePool = crate::pool::Pool<SqliteConnection>;
make_query_as!(SqliteQueryAs, Sqlite, SqliteRow);

View File

@ -55,6 +55,7 @@ pub mod ty_match;
#[doc(hidden)]
pub mod result_ext;
/// Types and traits for encoding values for the database.
pub mod encode {
pub use sqlx_core::encode::{Encode, IsNull};
@ -62,6 +63,7 @@ pub mod encode {
pub use sqlx_macros::Encode;
}
/// Types and traits for decoding values from the database.
pub mod decode {
pub use sqlx_core::decode::Decode;
@ -69,6 +71,7 @@ pub mod decode {
pub use sqlx_macros::Decode;
}
/// Convenience re-export of common traits.
pub mod prelude {
pub use super::Connect;
pub use super::Connection;