Skip to content

Commit 84d5760

Browse files
authored
Update docs to reflect support for MariaDB data types (#3026)
1 parent 978bd50 commit 84d5760

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

sqlx-mysql/src/types/mod.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//! Conversions between Rust and **MySQL** types.
1+
//! Conversions between Rust and **MySQL/MariaDB** types.
22
//!
33
//! # Types
44
//!
5-
//! | Rust type | MySQL type(s) |
5+
//! | Rust type | MySQL/MariaDB type(s) |
66
//! |---------------------------------------|------------------------------------------------------|
77
//! | `bool` | TINYINT(1), BOOLEAN, BOOL (see below) |
88
//! | `i8` | TINYINT |
@@ -17,7 +17,9 @@
1717
//! | `f64` | DOUBLE |
1818
//! | `&str`, [`String`] | VARCHAR, CHAR, TEXT |
1919
//! | `&[u8]`, `Vec<u8>` | VARBINARY, BINARY, BLOB |
20-
//! | `IpAddr`, `Ipv4Addr`, `Ipv6Addr` | VARCHAR, TEXT |
20+
//! | `IpAddr` | VARCHAR, TEXT |
21+
//! | `Ipv4Addr` | INET4 (MariaDB-only), VARCHAR, TEXT |
22+
//! | `Ipv6Addr` | INET6 (MariaDB-only), VARCHAR, TEXT |
2123
//!
2224
//! ##### Note: `BOOLEAN`/`BOOL` Type
2325
//! MySQL and MariaDB treat `BOOLEAN` as an alias of the `TINYINT` type:
@@ -40,7 +42,7 @@
4042
//!
4143
//! Requires the `chrono` Cargo feature flag.
4244
//!
43-
//! | Rust type | MySQL type(s) |
45+
//! | Rust type | MySQL/MariaDB type(s) |
4446
//! |---------------------------------------|------------------------------------------------------|
4547
//! | `chrono::DateTime<Utc>` | TIMESTAMP |
4648
//! | `chrono::DateTime<Local>` | TIMESTAMP |
@@ -52,7 +54,7 @@
5254
//!
5355
//! Requires the `time` Cargo feature flag.
5456
//!
55-
//! | Rust type | MySQL type(s) |
57+
//! | Rust type | MySQL/MariaDB type(s) |
5658
//! |---------------------------------------|------------------------------------------------------|
5759
//! | `time::PrimitiveDateTime` | DATETIME |
5860
//! | `time::OffsetDateTime` | TIMESTAMP |
@@ -62,32 +64,32 @@
6264
//! ### [`bigdecimal`](https://crates.io/crates/bigdecimal)
6365
//! Requires the `bigdecimal` Cargo feature flag.
6466
//!
65-
//! | Rust type | MySQL type(s) |
67+
//! | Rust type | MySQL/MariaDB type(s) |
6668
//! |---------------------------------------|------------------------------------------------------|
6769
//! | `bigdecimal::BigDecimal` | DECIMAL |
6870
//!
6971
//! ### [`decimal`](https://crates.io/crates/rust_decimal)
7072
//! Requires the `decimal` Cargo feature flag.
7173
//!
72-
//! | Rust type | MySQL type(s) |
74+
//! | Rust type | MySQL/MariaDB type(s) |
7375
//! |---------------------------------------|------------------------------------------------------|
7476
//! | `rust_decimal::Decimal` | DECIMAL |
7577
//!
7678
//! ### [`uuid`](https://crates.io/crates/uuid)
7779
//!
7880
//! Requires the `uuid` Cargo feature flag.
7981
//!
80-
//! | Rust type | MySQL type(s) |
82+
//! | Rust type | MySQL/MariaDB type(s) |
8183
//! |---------------------------------------|------------------------------------------------------|
8284
//! | `uuid::Uuid` | BINARY(16), VARCHAR, CHAR, TEXT |
83-
//! | `uuid::fmt::Hyphenated` | CHAR(36) |
85+
//! | `uuid::fmt::Hyphenated` | CHAR(36), UUID (MariaDB-only) |
8486
//! | `uuid::fmt::Simple` | CHAR(32) |
8587
//!
8688
//! ### [`json`](https://crates.io/crates/serde_json)
8789
//!
8890
//! Requires the `json` Cargo feature flag.
8991
//!
90-
//! | Rust type | MySQL type(s) |
92+
//! | Rust type | MySQL/MariaDB type(s) |
9193
//! |---------------------------------------|------------------------------------------------------|
9294
//! | [`Json<T>`] | JSON |
9395
//! | `serde_json::JsonValue` | JSON |
@@ -96,7 +98,7 @@
9698
//! # Nullable
9799
//!
98100
//! In addition, `Option<T>` is supported where `T` implements `Type`. An `Option<T>` represents
99-
//! a potentially `NULL` value from MySQL.
101+
//! a potentially `NULL` value from MySQL/MariaDB.
100102
101103
pub(crate) use sqlx_core::types::*;
102104

0 commit comments

Comments
 (0)