306
306
/// See [the README for `sqlx-cli`](https://crates.io/crates/sqlx-cli) for more information.
307
307
///
308
308
/// ## 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.
312
312
#[ macro_export]
313
313
#[ cfg_attr( docsrs, doc( cfg( feature = "macros" ) ) ) ]
314
314
macro_rules! query (
@@ -329,7 +329,7 @@ macro_rules! query (
329
329
} )
330
330
) ;
331
331
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
333
333
/// the query to ensure it's syntactically and semantically valid for the current database.
334
334
#[ macro_export]
335
335
#[ cfg_attr( docsrs, doc( cfg( feature = "macros" ) ) ) ]
@@ -342,12 +342,12 @@ macro_rules! query_unchecked (
342
342
} )
343
343
) ;
344
344
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.
346
346
///
347
347
/// Useful for large queries and potentially cleaner than multiline strings.
348
348
///
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.
351
351
///
352
352
/// The file must be relative to the project root (the directory containing `Cargo.toml`),
353
353
/// unlike `include_str!()` which uses compiler internals to get the path of the file where it
@@ -395,8 +395,9 @@ macro_rules! query_file (
395
395
} )
396
396
) ;
397
397
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.
400
401
#[ macro_export]
401
402
#[ cfg_attr( docsrs, doc( cfg( feature = "macros" ) ) ) ]
402
403
macro_rules! query_file_unchecked (
@@ -408,7 +409,8 @@ macro_rules! query_file_unchecked (
408
409
} )
409
410
) ;
410
411
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.
412
414
///
413
415
/// This lets you return the struct from a function or add your own trait implementations.
414
416
///
@@ -483,7 +485,8 @@ macro_rules! query_file_unchecked (
483
485
/// (`.execute()` is omitted as this macro requires at least one column to be returned.)
484
486
///
485
487
/// ### 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
487
490
/// additional override option:
488
491
///
489
492
/// If you select a column `foo as "foo: _"` (Postgres/SQLite) or `` foo as `foo: _` `` (MySQL)
@@ -558,7 +561,8 @@ macro_rules! query_file_unchecked (
558
561
/// `select id as "id!"` to override the inferred nullability because we know in practice
559
562
/// that column will never be `NULL` and it will fix the error.
560
563
///
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!`].
562
566
///
563
567
/// It unfortunately doesn't appear to be possible right now to make the error specifically mention
564
568
/// the field; this probably requires the `const-panic` feature (still unstable as of Rust 1.45).
@@ -573,7 +577,7 @@ macro_rules! query_as (
573
577
} )
574
578
) ;
575
579
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!` ].
577
581
///
578
582
/// Enforces requirements of both macros; see them for details.
579
583
///
@@ -617,7 +621,7 @@ macro_rules! query_file_as (
617
621
} )
618
622
) ;
619
623
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
621
625
/// the query to ensure it's syntactically and semantically valid for the current database.
622
626
#[ macro_export]
623
627
#[ cfg_attr( docsrs, doc( cfg( feature = "macros" ) ) ) ]
@@ -631,7 +635,7 @@ macro_rules! query_as_unchecked (
631
635
} )
632
636
) ;
633
637
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
635
639
/// still does parse the query to ensure it's syntactically and semantically valid
636
640
/// for the current database.
637
641
#[ macro_export]
@@ -646,7 +650,7 @@ macro_rules! query_file_as_unchecked (
646
650
} )
647
651
) ;
648
652
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
650
654
/// instance of [QueryScalar][crate::query::QueryScalar].
651
655
///
652
656
/// 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 (
656
660
/// getting a different type than expected, please check to see if your override syntax is correct
657
661
/// before opening an issue.**
658
662
///
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
660
664
/// is left up to inference.
661
665
///
662
- /// See [query!] for more information.
666
+ /// See [` query!`][`crate::query!` ] for more information.
663
667
#[ macro_export]
664
668
#[ cfg_attr( docsrs, doc( cfg( feature = "macros" ) ) ) ]
665
669
macro_rules! query_scalar (
@@ -671,7 +675,8 @@ macro_rules! query_scalar (
671
675
)
672
676
) ;
673
677
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!`].
675
680
#[ macro_export]
676
681
#[ cfg_attr( docsrs, doc( cfg( feature = "macros" ) ) ) ]
677
682
macro_rules! query_file_scalar (
@@ -683,8 +688,9 @@ macro_rules! query_file_scalar (
683
688
)
684
689
) ;
685
690
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
688
694
/// valid for the database, that it only produces one column and that the number of bind parameters
689
695
/// is correct.
690
696
///
@@ -700,8 +706,9 @@ macro_rules! query_scalar_unchecked (
700
706
)
701
707
) ;
702
708
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
705
712
/// semantically valid for the database, that it only produces one column and that the number of
706
713
/// bind parameters is correct.
707
714
///
0 commit comments