mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-19 08:39:44 +00:00
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
This commit is contained in:
@@ -46,12 +46,12 @@ pub struct PgAdvisoryLock {
|
||||
/// 64-bit integer, and one keyed by a pair of two 32-bit integers. The Postgres docs
|
||||
/// specify that these key spaces "do not overlap":
|
||||
///
|
||||
/// https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS
|
||||
/// <https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS>
|
||||
///
|
||||
/// The documentation for the `pg_locks` system view explains further how advisory locks
|
||||
/// are treated in Postgres:
|
||||
///
|
||||
/// https://www.postgresql.org/docs/current/view-pg-locks.html
|
||||
/// <https://www.postgresql.org/docs/current/view-pg-locks.html>
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[non_exhaustive]
|
||||
pub enum PgAdvisoryLockKey {
|
||||
|
||||
@@ -24,7 +24,7 @@ impl PgConnection {
|
||||
/// returned.
|
||||
///
|
||||
/// Command examples and accepted formats for `COPY` data are shown here:
|
||||
/// https://www.postgresql.org/docs/current/sql-copy.html
|
||||
/// <https://www.postgresql.org/docs/current/sql-copy.html>
|
||||
///
|
||||
/// ### Note
|
||||
/// [PgCopyIn::finish] or [PgCopyIn::abort] *must* be called when finished or the connection
|
||||
@@ -51,7 +51,7 @@ impl PgConnection {
|
||||
/// need to read and discard all the remaining queued data, which could take some time.
|
||||
///
|
||||
/// Command examples and accepted formats for `COPY` data are shown here:
|
||||
/// https://www.postgresql.org/docs/current/sql-copy.html
|
||||
/// <https://www.postgresql.org/docs/current/sql-copy.html>
|
||||
#[allow(clippy::needless_lifetimes)]
|
||||
pub async fn copy_out_raw<'c>(
|
||||
&'c mut self,
|
||||
@@ -61,7 +61,7 @@ impl PgConnection {
|
||||
}
|
||||
}
|
||||
|
||||
/// Implements methods for directly executing `COPY FROM/TO STDOUT` on a [`PgPool`].
|
||||
/// Implements methods for directly executing `COPY FROM/TO STDOUT` on a [`PgPool`][crate::PgPool].
|
||||
///
|
||||
/// This is a replacement for the inherent methods on `PgPool` which could not exist
|
||||
/// once the Postgres driver was moved out into its own crate.
|
||||
@@ -76,7 +76,7 @@ pub trait PgPoolCopyExt {
|
||||
/// returned.
|
||||
///
|
||||
/// Command examples and accepted formats for `COPY` data are shown here:
|
||||
/// https://www.postgresql.org/docs/current/sql-copy.html
|
||||
/// <https://www.postgresql.org/docs/current/sql-copy.html>
|
||||
///
|
||||
/// ### Note
|
||||
/// [PgCopyIn::finish] or [PgCopyIn::abort] *must* be called when finished or the connection
|
||||
@@ -104,7 +104,7 @@ pub trait PgPoolCopyExt {
|
||||
/// need to read and discard all the remaining queued data, which could take some time.
|
||||
///
|
||||
/// Command examples and accepted formats for `COPY` data are shown here:
|
||||
/// https://www.postgresql.org/docs/current/sql-copy.html
|
||||
/// <https://www.postgresql.org/docs/current/sql-copy.html>
|
||||
fn copy_out_raw<'a>(
|
||||
&'a self,
|
||||
statement: &'a str,
|
||||
|
||||
@@ -30,13 +30,13 @@ pub enum PgLQueryParseError {
|
||||
|
||||
/// Container for a Label Tree Query (`lquery`) in Postgres.
|
||||
///
|
||||
/// See https://www.postgresql.org/docs/current/ltree.html
|
||||
/// See <https://www.postgresql.org/docs/current/ltree.html>
|
||||
///
|
||||
/// ### Note: Requires Postgres 13+
|
||||
///
|
||||
/// This integration requires that the `lquery` type support the binary format in the Postgres
|
||||
/// wire protocol, which only became available in Postgres 13.
|
||||
/// ([Postgres 13.0 Release Notes, Additional Modules][https://www.postgresql.org/docs/13/release-13.html#id-1.11.6.11.5.14])
|
||||
/// ([Postgres 13.0 Release Notes, Additional Modules](https://www.postgresql.org/docs/13/release-13.html#id-1.11.6.11.5.14))
|
||||
///
|
||||
/// Ideally, SQLx's Postgres driver should support falling back to text format for types
|
||||
/// which don't have `typsend` and `typrecv` entries in `pg_type`, but that work still needs
|
||||
|
||||
@@ -66,13 +66,13 @@ impl Display for PgLTreeLabel {
|
||||
|
||||
/// Container for a Label Tree (`ltree`) in Postgres.
|
||||
///
|
||||
/// See https://www.postgresql.org/docs/current/ltree.html
|
||||
/// See <https://www.postgresql.org/docs/current/ltree.html>
|
||||
///
|
||||
/// ### Note: Requires Postgres 13+
|
||||
///
|
||||
/// This integration requires that the `ltree` type support the binary format in the Postgres
|
||||
/// wire protocol, which only became available in Postgres 13.
|
||||
/// ([Postgres 13.0 Release Notes, Additional Modules][https://www.postgresql.org/docs/13/release-13.html#id-1.11.6.11.5.14])
|
||||
/// ([Postgres 13.0 Release Notes, Additional Modules](https://www.postgresql.org/docs/13/release-13.html#id-1.11.6.11.5.14))
|
||||
///
|
||||
/// Ideally, SQLx's Postgres driver should support falling back to text format for types
|
||||
/// which don't have `typsend` and `typrecv` entries in `pg_type`, but that work still needs
|
||||
@@ -95,7 +95,7 @@ impl PgLTree {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// creates ltree from a [Vec<PgLTreeLabel>]
|
||||
/// creates ltree from a [`Vec<PgLTreeLabel>`]
|
||||
pub fn from(labels: Vec<PgLTreeLabel>) -> Self {
|
||||
Self { labels }
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ use std::{
|
||||
/// If you're not sure what locale your database is set to or how many decimal digits it specifies,
|
||||
/// you can execute `SHOW lc_monetary;` to get the locale name, and then look it up in this list
|
||||
/// (you can ignore the `.utf8` prefix):
|
||||
/// https://lh.2xlibre.net/values/frac_digits/
|
||||
/// <https://lh.2xlibre.net/values/frac_digits/>
|
||||
///
|
||||
/// If that link is dead and you're on a POSIX-compliant system (Unix, FreeBSD) you can also execute:
|
||||
///
|
||||
@@ -45,7 +45,7 @@ use std::{
|
||||
///
|
||||
/// Note that if `frac_digits` for the locale is outside the range `[0, 10]`, Postgres assumes
|
||||
/// it's a sentinel value and defaults to 2:
|
||||
/// https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/cash.c#L114-L123
|
||||
/// <https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/cash.c#L114-L123>
|
||||
///
|
||||
/// [`MONEY`]: https://www.postgresql.org/docs/current/datatype-money.html
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy, Default)]
|
||||
@@ -68,7 +68,7 @@ impl PgMoney {
|
||||
///
|
||||
/// See the type-level docs for an explanation of `locale_frac_digits`.
|
||||
///
|
||||
/// [`BigDecimal`]: crate::types::BigDecimal
|
||||
/// [`BigDecimal`]: bigdecimal::BigDecimal
|
||||
#[cfg(feature = "bigdecimal")]
|
||||
pub fn to_bigdecimal(self, locale_frac_digits: i64) -> bigdecimal::BigDecimal {
|
||||
let digits = num_bigint::BigInt::from(self.0);
|
||||
@@ -80,7 +80,7 @@ impl PgMoney {
|
||||
///
|
||||
/// See the type-level docs for an explanation of `locale_frac_digits`.
|
||||
///
|
||||
/// [`Decimal`]: crate::types::Decimal
|
||||
/// [`Decimal`]: rust_decimal::Decimal
|
||||
#[cfg(feature = "rust_decimal")]
|
||||
pub fn to_decimal(self, locale_frac_digits: u32) -> rust_decimal::Decimal {
|
||||
rust_decimal::Decimal::new(self.0, locale_frac_digits)
|
||||
@@ -93,7 +93,7 @@ impl PgMoney {
|
||||
/// Note that `Decimal` has 96 bits of precision, but `PgMoney` only has 63 plus the sign bit.
|
||||
/// If the value is larger than 63 bits it will be truncated.
|
||||
///
|
||||
/// [`Decimal`]: crate::types::Decimal
|
||||
/// [`Decimal`]: rust_decimal::Decimal
|
||||
#[cfg(feature = "rust_decimal")]
|
||||
pub fn from_decimal(mut decimal: rust_decimal::Decimal, locale_frac_digits: u32) -> Self {
|
||||
// this is all we need to convert to our expected locale's `frac_digits`
|
||||
@@ -116,7 +116,7 @@ impl PgMoney {
|
||||
Self(if is_negative { -value } else { value })
|
||||
}
|
||||
|
||||
/// Convert a [`BigDecimal`](crate::types::BigDecimal) value into money using the correct precision
|
||||
/// Convert a [`BigDecimal`](bigdecimal::BigDecimal) value into money using the correct precision
|
||||
/// defined in the PostgreSQL settings. The default precision is two.
|
||||
#[cfg(feature = "bigdecimal")]
|
||||
pub fn from_bigdecimal(
|
||||
|
||||
Reference in New Issue
Block a user