Add Simple format for Uuid for MySQL & SQLite. (#2469)

* Add Simple format for Uuid for MySQL & SQLite.

Copy pasted the implementation for `Hyphenated` and adapt.

* Add uuid Simple docs for SQLite
This commit is contained in:
Midas Lambrichts
2023-05-04 22:14:06 +02:00
committed by GitHub
parent 003878698e
commit cbf8dd37e9
6 changed files with 79 additions and 2 deletions

View File

@@ -196,3 +196,11 @@ test_type!(uuid_hyphenated<sqlx::types::uuid::fmt::Hyphenated>(Sqlite,
"'00000000-0000-0000-0000-000000000000'"
== sqlx::types::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap().hyphenated()
));
#[cfg(feature = "uuid")]
test_type!(uuid_simple<sqlx::types::uuid::fmt::Simple>(Sqlite,
"'b731678f636f4135bc6f19440c13bd19'"
== sqlx::types::Uuid::parse_str("b731678f636f4135bc6f19440c13bd19").unwrap().simple(),
"'00000000000000000000000000000000'"
== sqlx::types::Uuid::parse_str("00000000000000000000000000000000").unwrap().simple()
));