macro_rules! insert_or_update_parent { ($self:expr, $conn:expr, $table_name:expr, $timestamps_field:ident, $keys_field:ident, $encoded_name:ident) => { ... }; }
Expand description
Helper to generate the upsert for the parent tables.
This handles checking if the row already exists, and only updates the
timestamp it if it hasn’t been updated recently. This also handles keeping
a cached map of the id
value.
Unfortunately it is a bit tricky to share this code without a macro.