I'm wondering if it's somehow possible to figure out if a postgres upsert query resulted in an insert or an update.
Something like this psuedocode:
insert into teammates (id, email, avatar, timezone)
values ($1, $2, $3, $4)
on conflict (id) do update set
avatar = $3,
timezone = $4
returning id, (updated = didUpdate);