this post was submitted on 07 Aug 2023
11 points (100.0% liked)
Rust Programming
8126 readers
1 users here now
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Before the upsert, do a select where the result is optional. Then if_some() it was an update, if_none() it was an insert.
Looks like the on_conflict is on the ap_url, so I would use that as the key you're trying to pull in the select.