refactor: fewer non-macro queries
Some checks failed
/ integration-test--firefox (push) Failing after 3m5s

This commit is contained in:
Robert Perce 2026-01-26 22:14:58 -06:00
parent 69e23fd9bb
commit 84c41dda4d
5 changed files with 119 additions and 111 deletions

View file

@ -55,15 +55,9 @@ mod get {
let mut calendar = Calendar::new();
calendar.name(&calname);
calendar.append_property(("PRODID", "Mascarpone CRM"));
let contacts: Vec<HydratedContact> = sqlx::query_as(
"select id, birthday, (
select string_agg(name,'\x1c' order by sort)
from names where contact_id = c.id
) as names
from contacts c",
)
.fetch_all(&pool)
.await?;
// TODO; this does some db work to pull in last_modified_date that we don't use
let contacts = HydratedContact::all(&pool).await?;
for contact in &contacts {
if let Some(Birthday::Date(yo_date)) = &contact.birthday {
if let Some(date) = NaiveDate::from_ymd_opt(