#![forbid(unsafe_code)] /// Defines a new UUID type wrapper macro_rules! new_uuid { ($name:ident) => { #[derive( Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, serde::Serialize, serde::Deserialize, )] #[serde(transparent)] pub struct $name(pub Uuid); impl sqlx::Type for $name where Uuid: sqlx::Type, { fn type_info() -> ::TypeInfo { Uuid::type_info() } } impl<'r, DB: sqlx::Database> sqlx::Decode<'r, DB> for $name where Uuid: sqlx::Decode<'r, DB>, { fn decode( value: >::ValueRef, ) -> std::result::Result { Uuid::decode(value).map(Self) } } impl<'q, DB: sqlx::Database> sqlx::Encode<'q, DB> for $name where Uuid: sqlx::Encode<'q, DB>, { fn encode_by_ref( &self, buf: &mut >::ArgumentBuffer, ) -> sqlx::encode::IsNull { self.0.encode_by_ref(buf) } } }; } pub mod api; pub mod record; pub mod utils;