Move to sqlx

This commit is contained in:
2024-12-25 23:28:22 +01:00
parent 3ee5e51767
commit 8002a93069
28 changed files with 2508 additions and 22526 deletions

16
src/serializers/date.rs Normal file
View File

@@ -0,0 +1,16 @@
use chrono::NaiveDate;
use serde::Serializer;
const FORMAT: &str = "%Y-%m-%d";
pub mod naive_date_serializer {
use super::*;
pub fn serialize<S>(date: &NaiveDate, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
let formatted_date = date.format(FORMAT).to_string();
serializer.serialize_str(&formatted_date)
}
}