Skip to content

Commit 2a8906d

Browse files
committed
add more documentation
1 parent c2dee0c commit 2a8906d

File tree

8 files changed

+13
-3
lines changed

8 files changed

+13
-3
lines changed

sqlx-core/src/mysql/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ mod types;
2424
mod util;
2525

2626
/// An alias for [`Pool`], specialized for **MySQL**.
27+
#[cfg_attr(docsrs, doc(cfg(feature = "mysql")))]
2728
pub type MySqlPool = crate::pool::Pool<MySqlConnection>;
2829

2930
make_query_as!(MySqlQueryAs, MySql, MySqlRow);

sqlx-core/src/postgres/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::postgres::stream::PgStream;
1616
use crate::postgres::{sasl, tls};
1717
use crate::url::Url;
1818

19-
/// An asynchronous connection to a [Postgres][super::Postgres] database.
19+
/// An asynchronous connection to a [Postgres](struct.Postgres.html) database.
2020
///
2121
/// The connection string expected by [Connect::connect] should be a PostgreSQL connection
2222
/// string, as documented at

sqlx-core/src/postgres/database.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Types which represent various database drivers.
2+
13
use crate::database::{Database, HasCursor, HasRawValue, HasRow};
24
use crate::postgres::row::PgValue;
35

sqlx-core/src/postgres/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ mod tls;
2424
pub mod types;
2525

2626
/// An alias for [`Pool`][crate::Pool], specialized for **Postgres**.
27+
#[cfg_attr(docsrs, doc(cfg(feature = "postgres")))]
2728
pub type PgPool = crate::pool::Pool<PgConnection>;
2829

2930
make_query_as!(PgQueryAs, Postgres, PgRow);

sqlx-core/src/postgres/types/raw/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ mod numeric;
22
mod record;
33

44
pub use numeric::{PgNumeric, PgNumericSign};
5-
pub use record::{PgRecordEncoder, PgRecordDecoder};
5+
pub use record::{PgRecordDecoder, PgRecordEncoder};

sqlx-core/src/sqlite/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::url::Url;
2222
#[derive(Clone, Copy)]
2323
pub(super) struct SqliteConnectionHandle(pub(super) NonNull<sqlite3>);
2424

25-
/// A connection to a [SQLite][super::Sqlite] database.
25+
/// A connection to a [Sqlite](struct.Sqlite.html) database.
2626
pub struct SqliteConnection {
2727
pub(super) handle: SqliteConnectionHandle,
2828
pub(super) worker: Worker,

sqlx-core/src/sqlite/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! **SQLite** database and connection types.
2+
13
mod arguments;
24
mod connection;
35
mod cursor;
@@ -20,6 +22,7 @@ pub use types::SqliteTypeInfo;
2022
pub use value::SqliteValue;
2123

2224
/// An alias for [`Pool`][crate::Pool], specialized for **Sqlite**.
25+
#[cfg_attr(docsrs, doc(cfg(feature = "sqlite")))]
2326
pub type SqlitePool = crate::pool::Pool<SqliteConnection>;
2427

2528
make_query_as!(SqliteQueryAs, Sqlite, SqliteRow);

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,23 @@ pub mod ty_match;
5555
#[doc(hidden)]
5656
pub mod result_ext;
5757

58+
/// Types and traits for encoding values for the database.
5859
pub mod encode {
5960
pub use sqlx_core::encode::{Encode, IsNull};
6061

6162
#[cfg(feature = "macros")]
6263
pub use sqlx_macros::Encode;
6364
}
6465

66+
/// Types and traits for decoding values from the database.
6567
pub mod decode {
6668
pub use sqlx_core::decode::Decode;
6769

6870
#[cfg(feature = "macros")]
6971
pub use sqlx_macros::Decode;
7072
}
7173

74+
/// Convenience re-export of common traits.
7275
pub mod prelude {
7376
pub use super::Connect;
7477
pub use super::Connection;

0 commit comments

Comments
 (0)