diff --git a/Cargo.toml b/Cargo.toml index 83b7e9d..bfdb782 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,13 +49,11 @@ log = "0.4.22" async-trait = "0.1.81" chorus-macros = { path = "./chorus-macros", version = "0" } # Note: version here is used when releasing. This will use the latest release. Make sure to republish the crate when code in macros is changed! sqlx = { version = "0.8.0", features = [ - "mysql", - "sqlite", "json", "chrono", "ipnetwork", "runtime-tokio-rustls", - "any", + "postgres", ], optional = true } discortp = { version = "0.5.0", optional = true, features = [ "rtp", diff --git a/chorus-macros/src/lib.rs b/chorus-macros/src/lib.rs index 1c3a8bd..c2a23c5 100644 --- a/chorus-macros/src/lib.rs +++ b/chorus-macros/src/lib.rs @@ -164,23 +164,23 @@ pub fn sqlx_bitflag_derive(input: TokenStream) -> TokenStream { quote!{ #[cfg(feature = "sqlx")] - impl sqlx::Type for #name { - fn type_info() -> sqlx::any::AnyTypeInfo { - as sqlx::Type>::type_info() + impl sqlx::Type for #name { + fn type_info() -> sqlx::postgres::PgTypeInfo { + as sqlx::Type>::type_info() } } #[cfg(feature = "sqlx")] - impl<'q> sqlx::Encode<'q, sqlx::Any> for #name { - fn encode_by_ref(&self, buf: &mut ::ArgumentBuffer<'q>) -> Result { - as sqlx::Encode>::encode_by_ref(&self.bits().to_be_bytes().into(), buf) + impl<'q> sqlx::Encode<'q, sqlx::Postgres> for #name { + fn encode_by_ref(&self, buf: &mut ::ArgumentBuffer<'q>) -> Result { + as sqlx::Encode>::encode_by_ref(&self.bits().to_be_bytes().into(), buf) } } #[cfg(feature = "sqlx")] - impl<'q> sqlx::Decode<'q, sqlx::Any> for #name { - fn decode(value: ::ValueRef<'q>) -> Result { - let vec = as sqlx::Decode>::decode(value)?; + impl<'q> sqlx::Decode<'q, sqlx::Postgres> for #name { + fn decode(value: ::ValueRef<'q>) -> Result { + let vec = as sqlx::Decode>::decode(value)?; Ok(Self::from_bits(vec_u8_to_u64(vec)).unwrap()) } } diff --git a/src/types/entities/channel.rs b/src/types/entities/channel.rs index 3d6cd3a..f794bba 100644 --- a/src/types/entities/channel.rs +++ b/src/types/entities/channel.rs @@ -342,7 +342,7 @@ pub struct DefaultReaction { )] #[cfg_attr(feature = "sqlx", derive(sqlx::Type))] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] -#[repr(u32)] +#[repr(i32)] /// # Reference /// See pub enum ChannelType {