Skip to content

Commit eaad7b2

Browse files
authored
doc: Minor rust docs fixes (#3312)
* Fixed some rust docs intra-doc non functioning links * Minor tweaks * Added warning for MSSQL not being functional yet * Fixed requested changes * Readded missing time * Aligned table
1 parent 4fc5b30 commit eaad7b2

File tree

15 files changed

+32
-40
lines changed

15 files changed

+32
-40
lines changed

sqlx-core/src/any/connection/backend.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ pub trait AnyConnectionBackend: std::any::Any + Debug + Send + 'static {
2626
fn ping(&mut self) -> BoxFuture<'_, crate::Result<()>>;
2727

2828
/// Begin a new transaction or establish a savepoint within the active transaction.
29-
///
30-
/// Returns a [`Transaction`] for controlling and tracking the new transaction.
3129
fn begin(&mut self) -> BoxFuture<'_, crate::Result<()>>;
3230

3331
fn commit(&mut self) -> BoxFuture<'_, crate::Result<()>>;

sqlx-core/src/any/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! **SEE DOCUMENTATION BEFORE USE**. Generic database driver with the specific driver selected at runtime.
22
//!
33
//! The underlying database drivers are chosen at runtime from the list set via
4-
//! [`install_drivers`][self::driver::install_drivers). Any use of `AnyConnection` or `AnyPool`
4+
//! [`install_drivers`][self::driver::install_drivers]. Any use of `AnyConnection` or `AnyPool`
55
//! without this will panic.
66
use crate::executor::Executor;
77

sqlx-core/src/database.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! | Database | Version | Driver |
1111
//! | - | - | - |
1212
//! | [MariaDB] | 10.1+ | [`mysql`] |
13-
//! | [Microsoft SQL Server] | 2019 | [`mssql`] |
13+
//! | [Microsoft SQL Server] | 2019 | [`mssql`] (Pending a full rewrite) |
1414
//! | [MySQL] | 5.6, 5.7, 8.0 | [`mysql`] |
1515
//! | [PostgreSQL] | 9.5+ | [`postgres`] |
1616
//! | [SQLite] | 3.20.1+ | [`sqlite`] |

sqlx-core/src/executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ use std::fmt::Debug;
2222
/// * [`&Pool`](super::pool::Pool)
2323
/// * [`&mut Connection`](super::connection::Connection)
2424
///
25-
/// The [`Executor`](crate::Executor) impls for [`Transaction`](crate::Transaction)
25+
/// The [`Executor`] impls for [`Transaction`](crate::transaction::Transaction)
2626
/// and [`PoolConnection`](crate::pool::PoolConnection) have been deleted because they
2727
/// cannot exist in the new crate architecture without rewriting the Executor trait entirely.
28-
/// To fix this breakage, simply add a dereference where an impl [`Executor`](crate::Executor) is expected, as
28+
/// To fix this breakage, simply add a dereference where an impl [`Executor`] is expected, as
2929
/// they both dereference to the inner connection type which will still implement it:
3030
/// * `&mut transaction` -> `&mut *transaction`
3131
/// * `&mut connection` -> `&mut *connection`

sqlx-core/src/from_row.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ use crate::{error::Error, row::Row};
173173
/// .fetch_one(&mut some_connection)
174174
/// .await?;
175175
///
176-
/// `Default` for `Vec<Address>` is an empty vector.
176+
/// // `Default` for `Vec<Address>` is an empty vector.
177177
/// assert!(user.addresses.is_empty());
178178
/// ```
179179
///

sqlx-core/src/pool/mod.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! SQLx provides a canonical connection pool implementation intended to satisfy the majority
1212
//! of use cases.
1313
//!
14-
//! See [Pool][crate::pool::Pool] for details.
14+
//! See [Pool] for details.
1515
//!
1616
//! Type aliases are provided for each database to make it easier to sprinkle `Pool` through
1717
//! your codebase:
@@ -110,7 +110,7 @@ pub use self::maybe::MaybePoolConnection;
110110
/// when at this limit and all connections are checked out, the task will be made to wait until
111111
/// a connection becomes available.
112112
///
113-
/// You can configure the connection limit, and other parameters, using [PoolOptions][crate::pool::PoolOptions].
113+
/// You can configure the connection limit, and other parameters, using [PoolOptions].
114114
///
115115
/// Calls to `acquire()` are fair, i.e. fulfilled on a first-come, first-serve basis.
116116
///
@@ -310,7 +310,7 @@ impl<DB: Database> Pool<DB> {
310310
///
311311
/// The pool will establish connections only as needed.
312312
///
313-
/// Refer to the relevant [`ConnectOptions`] impl for your database for the expected URL format:
313+
/// Refer to the relevant [`ConnectOptions`][crate::connection::ConnectOptions] impl for your database for the expected URL format:
314314
///
315315
/// * Postgres: [`PgConnectOptions`][crate::postgres::PgConnectOptions]
316316
/// * MySQL: [`MySqlConnectOptions`][crate::mysql::MySqlConnectOptions]
@@ -502,12 +502,6 @@ impl<DB: Database> Pool<DB> {
502502
}
503503

504504
/// Returns the number of connections active and idle (not in use).
505-
///
506-
/// As of 0.6.0, this has been fixed to use a separate atomic counter and so should be fine to
507-
/// call even at high load.
508-
///
509-
/// This previously called [`crossbeam::queue::ArrayQueue::len()`] which waits for the head and
510-
/// tail pointers to be in a consistent state, which may never happen at high levels of churn.
511505
pub fn num_idle(&self) -> usize {
512506
self.0.num_idle()
513507
}

sqlx-mysql/src/options/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl MySqlConnectOptions {
349349
/// By default, this is `true` (`NO_ENGINE_SUBSTITUTION` is passed, forbidding engine
350350
/// substitution).
351351
///
352-
/// https://mariadb.com/kb/en/sql-mode/
352+
/// <https://mariadb.com/kb/en/sql-mode/>
353353
pub fn no_engine_subsitution(mut self, flag_val: bool) -> Self {
354354
self.no_engine_subsitution = flag_val;
355355
self

sqlx-mysql/src/types/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//! | `Ipv4Addr` | INET4 (MariaDB-only), VARCHAR, TEXT |
2222
//! | `Ipv6Addr` | INET6 (MariaDB-only), VARCHAR, TEXT |
2323
//! | [`MySqlTime`] | TIME (encode and decode full range) |
24-
//! | [`Duration`] | TIME (for decoding positive values only) |
24+
//! | [`Duration`][std::time::Duration] | TIME (for decoding positive values only) |
2525
//!
2626
//! ##### Note: `BOOLEAN`/`BOOL` Type
2727
//! MySQL and MariaDB treat `BOOLEAN` as an alias of the `TINYINT` type:

sqlx-mysql/src/types/mysql_time.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::time::Duration;
1818
/// Allowed range is `-838:59:59.0` to `838:59:59.0`.
1919
///
2020
/// If this value is used for a time-of-day, the range should be `00:00:00.0` to `23:59:59.999999`.
21-
/// You can use [`Self::is_time_of_day()`] to check this easily.
21+
/// You can use [`Self::is_valid_time_of_day()`] to check this easily.
2222
///
2323
/// * [MySQL Manual 13.2.3: The TIME Type](https://dev.mysql.com/doc/refman/8.3/en/time.html)
2424
/// * [MariaDB Manual: TIME](https://mariadb.com/kb/en/time/)
@@ -125,7 +125,7 @@ impl MySqlTime {
125125
/// Construct a [`MySqlTime`] that is valid for use as a `TIME` value.
126126
///
127127
/// ### Errors
128-
/// * [`MySqlTimeError::NegativeZero`] if all fields are 0 but `sign` is [`MySqlSign::Negative`].
128+
/// * [`MySqlTimeError::NegativeZero`] if all fields are 0 but `sign` is [`MySqlTimeSign::Negative`].
129129
/// * [`MySqlTimeError::FieldRange`] if any field is out of range:
130130
/// * `hours > 838`
131131
/// * `minutes > 59`

sqlx-postgres/src/advisory_lock.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ pub struct PgAdvisoryLock {
4646
/// 64-bit integer, and one keyed by a pair of two 32-bit integers. The Postgres docs
4747
/// specify that these key spaces "do not overlap":
4848
///
49-
/// https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS
49+
/// <https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS>
5050
///
5151
/// The documentation for the `pg_locks` system view explains further how advisory locks
5252
/// are treated in Postgres:
5353
///
54-
/// https://www.postgresql.org/docs/current/view-pg-locks.html
54+
/// <https://www.postgresql.org/docs/current/view-pg-locks.html>
5555
#[derive(Debug, Clone, PartialEq, Eq)]
5656
#[non_exhaustive]
5757
pub enum PgAdvisoryLockKey {

0 commit comments

Comments
 (0)