mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-04-06 10:24:04 +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:
@@ -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