mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
fix compilation
This commit is contained in:
@@ -15,14 +15,14 @@ pub fn sqlx_derive(input: TokenStream) -> TokenStream {
|
||||
|
||||
let gen = quote! {
|
||||
impl<'q> sqlx::encode::Encode<'q, sqlx::sqlite::Sqlite> for #name {
|
||||
fn encode_by_ref(&self, buf: &mut Vec<sqlx::sqlite::SqliteArgumentValue<'q>>) -> sqlx::encode::IsNull{
|
||||
fn encode_by_ref(&self, buf: &mut Vec<sqlx::sqlite::SqliteArgumentValue<'q>>) -> sqlx::encode::IsNull {
|
||||
num_traits::ToPrimitive::to_i32(self).expect("invalid type").encode(buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl<'de> sqlx::decode::Decode<'de, sqlx::sqlite::Sqlite> for #name {
|
||||
fn decode(value: sqlx::sqlite::SqliteValueRef) -> std::result::Result<Self, sqlx::BoxDynError> {
|
||||
fn decode(value: sqlx::sqlite::SqliteValueRef) -> std::result::Result<Self, Box<dyn std::error::Error + 'static + Send + Sync>> {
|
||||
let raw: i32 = sqlx::decode::Decode::decode(value)?;
|
||||
|
||||
Ok(num_traits::FromPrimitive::from_i32(raw).unwrap_or_default())
|
||||
|
||||
@@ -2172,7 +2172,7 @@ impl sqlx::encode::Encode<'_, sqlx::sqlite::Sqlite> for MuteDuration {
|
||||
impl<'de> sqlx::decode::Decode<'de, sqlx::sqlite::Sqlite> for MuteDuration {
|
||||
fn decode(
|
||||
value: sqlx::sqlite::SqliteValueRef,
|
||||
) -> std::result::Result<Self, sqlx::error::BoxDynError> {
|
||||
) -> std::result::Result<Self, Box<dyn std::error::Error + 'static + Send + Sync>> {
|
||||
// Negative values other than -1 should not be in the
|
||||
// database. If found they'll be NotMuted.
|
||||
let raw: i32 = sqlx::decode::Decode::decode(value)?;
|
||||
|
||||
@@ -364,14 +364,15 @@ ALTER TABLE chats ADD COLUMN muted_until INTEGER DEFAULT 0;
|
||||
UPDATE chats SET grpid='' WHERE type=100;
|
||||
"#,
|
||||
)
|
||||
.await?;
|
||||
.await?;
|
||||
|
||||
migrate(
|
||||
64,
|
||||
r#"
|
||||
ALTER TABLE msgs ADD COLUMN error TEXT DEFAULT '';
|
||||
"#,
|
||||
).await?;
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user