sqlx_mysql/
type_checking.rs

1// Type mappings used by the macros and `Debug` impls.
2
3#[allow(unused_imports)]
4use sqlx_core as sqlx;
5
6use crate::MySql;
7
8impl_type_checking!(
9    MySql {
10        u8,
11        u16,
12        u32,
13        u64,
14        i8,
15        i16,
16        i32,
17        i64,
18        f32,
19        f64,
20
21        // ordering is important here as otherwise we might infer strings to be binary
22        // CHAR, VAR_CHAR, TEXT
23        String,
24
25        // BINARY, VAR_BINARY, BLOB
26        Vec<u8>,
27
28        // Types from third-party crates need to be referenced at a known path
29        // for the macros to work, but we don't want to require the user to add extra dependencies.
30        #[cfg(all(feature = "chrono", not(feature = "time")))]
31        sqlx::types::chrono::NaiveTime,
32
33        #[cfg(all(feature = "chrono", not(feature = "time")))]
34        sqlx::types::chrono::NaiveDate,
35
36        #[cfg(all(feature = "chrono", not(feature = "time")))]
37        sqlx::types::chrono::NaiveDateTime,
38
39        #[cfg(all(feature = "chrono", not(feature = "time")))]
40        sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc>,
41
42        #[cfg(feature = "time")]
43        sqlx::types::time::Time,
44
45        #[cfg(feature = "time")]
46        sqlx::types::time::Date,
47
48        #[cfg(feature = "time")]
49        sqlx::types::time::PrimitiveDateTime,
50
51        #[cfg(feature = "time")]
52        sqlx::types::time::OffsetDateTime,
53
54        #[cfg(feature = "bigdecimal")]
55        sqlx::types::BigDecimal,
56
57        #[cfg(feature = "rust_decimal")]
58        sqlx::types::Decimal,
59
60        #[cfg(feature = "json")]
61        sqlx::types::JsonValue,
62    },
63    ParamChecking::Weak,
64    feature-types: info => info.__type_feature_gate(),
65);