Skip to content

Commit 240b4ff

Browse files
authored
Fix several inter doc links (#2954)
1 parent f960d5b commit 240b4ff

File tree

4 files changed

+37
-27
lines changed

4 files changed

+37
-27
lines changed

src/any/install_drivers_note.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ The underlying database drivers are chosen at runtime from the list set via
44
without this will panic.
55

66
It is recommended to use [`install_default_drivers`][crate::any::install_default_drivers] to activate all currently compiled-in drivers.
7-
7+
8+
[`AnyConnection`]: sqlx_core::any::AnyConnection
9+
[`AnyPool`]: sqlx_core::any::AnyPool

src/any/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ pub(crate) mod reexports {
2727
///
2828
/// ### Panics
2929
/// If [`install_drivers`] has already been called *not* through this function.
30+
///
31+
/// [`AnyConnection`]: sqlx_core::any::AnyConnection
3032
pub fn install_default_drivers() {
3133
static ONCE: Once = Once::new();
3234

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub use sqlx_core::rt as __rt;
9797
/// * Postgres: [postgres::types]
9898
/// * MySQL: [mysql::types]
9999
/// * SQLite: [sqlite::types]
100-
/// * MSSQL: [mssql::types]
101100
///
102101
/// Any external types that have had [`Type`] implemented for, are re-exported in this module
103102
/// for convenience as downstream users need to use a compatible version of the external crate
@@ -112,7 +111,7 @@ pub mod types {
112111
pub use sqlx_macros::Type;
113112
}
114113

115-
/// Provides [`Encode`](encode::Encode) for encoding values for the database.
114+
/// Provides [`Encode`] for encoding values for the database.
116115
pub mod encode {
117116
pub use sqlx_core::encode::{Encode, IsNull};
118117

@@ -123,7 +122,7 @@ pub mod encode {
123122

124123
pub use self::encode::Encode;
125124

126-
/// Provides [`Decode`](decode::Decode) for decoding values from the database.
125+
/// Provides [`Decode`] for decoding values from the database.
127126
pub mod decode {
128127
pub use sqlx_core::decode::Decode;
129128

src/macros/mod.rs

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@
306306
/// See [the README for `sqlx-cli`](https://crates.io/crates/sqlx-cli) for more information.
307307
///
308308
/// ## See Also
309-
/// * [query_as!] if you want to use a struct you can name,
310-
/// * [query_file!] if you want to define the SQL query out-of-line,
311-
/// * [query_file_as!] if you want both of the above.
309+
/// * [`query_as!`][`crate::query_as!`] if you want to use a struct you can name,
310+
/// * [`query_file!`][`crate::query_file!`] if you want to define the SQL query out-of-line,
311+
/// * [`query_file_as!`][`crate::query_file_as!`] if you want both of the above.
312312
#[macro_export]
313313
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
314314
macro_rules! query (
@@ -329,7 +329,7 @@ macro_rules! query (
329329
})
330330
);
331331

332-
/// A variant of [query!] which does not check the input or output types. This still does parse
332+
/// A variant of [`query!`][`crate::query!`] which does not check the input or output types. This still does parse
333333
/// the query to ensure it's syntactically and semantically valid for the current database.
334334
#[macro_export]
335335
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
@@ -342,12 +342,12 @@ macro_rules! query_unchecked (
342342
})
343343
);
344344

345-
/// A variant of [query!] where the SQL query is stored in a separate file.
345+
/// A variant of [`query!`][`crate::query!`] where the SQL query is stored in a separate file.
346346
///
347347
/// Useful for large queries and potentially cleaner than multiline strings.
348348
///
349-
/// The syntax and requirements (see [query!]) are the same except the SQL string is replaced by a
350-
/// file path.
349+
/// The syntax and requirements (see [`query!`][`crate::query!`]) are the same except the SQL
350+
/// string is replaced by a file path.
351351
///
352352
/// The file must be relative to the project root (the directory containing `Cargo.toml`),
353353
/// unlike `include_str!()` which uses compiler internals to get the path of the file where it
@@ -395,8 +395,9 @@ macro_rules! query_file (
395395
})
396396
);
397397

398-
/// A variant of [query_file!] which does not check the input or output types. This still does parse
399-
/// the query to ensure it's syntactically and semantically valid for the current database.
398+
/// A variant of [`query_file!`][`crate::query_file!`] which does not check the input or output
399+
/// types. This still does parse the query to ensure it's syntactically and semantically valid
400+
/// for the current database.
400401
#[macro_export]
401402
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
402403
macro_rules! query_file_unchecked (
@@ -408,7 +409,8 @@ macro_rules! query_file_unchecked (
408409
})
409410
);
410411

411-
/// A variant of [query!] which takes a path to an explicitly defined struct as the output type.
412+
/// A variant of [`query!`][`crate::query!`] which takes a path to an explicitly defined struct
413+
/// as the output type.
412414
///
413415
/// This lets you return the struct from a function or add your own trait implementations.
414416
///
@@ -483,7 +485,8 @@ macro_rules! query_file_unchecked (
483485
/// (`.execute()` is omitted as this macro requires at least one column to be returned.)
484486
///
485487
/// ### Column Type Override: Infer from Struct Field
486-
/// In addition to the column type overrides supported by [query!], `query_as!()` supports an
488+
/// In addition to the column type overrides supported by [`query!`][`crate::query!`],
489+
/// [`query_as!()`][`crate::query_as!`] supports an
487490
/// additional override option:
488491
///
489492
/// If you select a column `foo as "foo: _"` (Postgres/SQLite) or `` foo as `foo: _` `` (MySQL)
@@ -558,7 +561,8 @@ macro_rules! query_file_unchecked (
558561
/// `select id as "id!"` to override the inferred nullability because we know in practice
559562
/// that column will never be `NULL` and it will fix the error.
560563
///
561-
/// Nullability inference and type overrides are discussed in detail in the docs for [query!].
564+
/// Nullability inference and type overrides are discussed in detail in the docs for
565+
/// [`query!`][`crate::query!`].
562566
///
563567
/// It unfortunately doesn't appear to be possible right now to make the error specifically mention
564568
/// the field; this probably requires the `const-panic` feature (still unstable as of Rust 1.45).
@@ -573,7 +577,7 @@ macro_rules! query_as (
573577
})
574578
);
575579

576-
/// Combines the syntaxes of [query_as!] and [query_file!].
580+
/// Combines the syntaxes of [`query_as!`][`crate::query_as!`] and [`query_file!`][`crate::query_file!`].
577581
///
578582
/// Enforces requirements of both macros; see them for details.
579583
///
@@ -617,7 +621,7 @@ macro_rules! query_file_as (
617621
})
618622
);
619623

620-
/// A variant of [query_as!] which does not check the input or output types. This still does parse
624+
/// A variant of [`query_as!`][`crate::query_as!`] which does not check the input or output types. This still does parse
621625
/// the query to ensure it's syntactically and semantically valid for the current database.
622626
#[macro_export]
623627
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
@@ -631,7 +635,7 @@ macro_rules! query_as_unchecked (
631635
})
632636
);
633637

634-
/// A variant of [query_file_as!] which does not check the input or output types. This
638+
/// A variant of [`query_file_as!`][`crate::query_file_as!`] which does not check the input or output types. This
635639
/// still does parse the query to ensure it's syntactically and semantically valid
636640
/// for the current database.
637641
#[macro_export]
@@ -646,7 +650,7 @@ macro_rules! query_file_as_unchecked (
646650
})
647651
);
648652

649-
/// A variant of [query!] which expects a single column from the query and evaluates to an
653+
/// A variant of [`query!`][`crate::query!`] which expects a single column from the query and evaluates to an
650654
/// instance of [QueryScalar][crate::query::QueryScalar].
651655
///
652656
/// The name of the column is not required to be a valid Rust identifier, however you can still
@@ -656,10 +660,10 @@ macro_rules! query_file_as_unchecked (
656660
/// getting a different type than expected, please check to see if your override syntax is correct
657661
/// before opening an issue.**
658662
///
659-
/// Wildcard overrides like in [query_as!] are also allowed, in which case the output type
663+
/// Wildcard overrides like in [`query_as!`][`crate::query_as!`] are also allowed, in which case the output type
660664
/// is left up to inference.
661665
///
662-
/// See [query!] for more information.
666+
/// See [`query!`][`crate::query!`] for more information.
663667
#[macro_export]
664668
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
665669
macro_rules! query_scalar (
@@ -671,7 +675,8 @@ macro_rules! query_scalar (
671675
)
672676
);
673677

674-
/// A variant of [query_scalar!] which takes a file path like [query_file!].
678+
/// A variant of [`query_scalar!`][`crate::query_scalar!`] which takes a file path like
679+
/// [`query_file!`][`crate::query_file!`].
675680
#[macro_export]
676681
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
677682
macro_rules! query_file_scalar (
@@ -683,8 +688,9 @@ macro_rules! query_file_scalar (
683688
)
684689
);
685690

686-
/// A variant of [query_scalar!] which does not typecheck bind parameters and leaves the output type
687-
/// to inference. The query itself is still checked that it is syntactically and semantically
691+
/// A variant of [`query_scalar!`][`crate::query_scalar!`] which does not typecheck bind parameters
692+
/// and leaves the output type to inference.
693+
/// The query itself is still checked that it is syntactically and semantically
688694
/// valid for the database, that it only produces one column and that the number of bind parameters
689695
/// is correct.
690696
///
@@ -700,8 +706,9 @@ macro_rules! query_scalar_unchecked (
700706
)
701707
);
702708

703-
/// A variant of [query_file_scalar!] which does not typecheck bind parameters and leaves the output
704-
/// type to inference. The query itself is still checked that it is syntactically and
709+
/// A variant of [`query_file_scalar!`][`crate::query_file_scalar!`] which does not typecheck bind
710+
/// parameters and leaves the output type to inference.
711+
/// The query itself is still checked that it is syntactically and
705712
/// semantically valid for the database, that it only produces one column and that the number of
706713
/// bind parameters is correct.
707714
///

0 commit comments

Comments
 (0)