2023-04-20 16:02:41 +02:00
|
|
|
#[macro_export]
|
2021-07-26 23:10:12 +02:00
|
|
|
macro_rules! upend_insert_val {
|
|
|
|
($db_connection:expr, $entity:expr, $attribute:expr, $value:expr) => {{
|
2022-02-02 17:13:23 +01:00
|
|
|
$db_connection.insert_entry(Entry {
|
|
|
|
entity: $entity.clone(),
|
|
|
|
attribute: String::from($attribute),
|
2023-06-25 15:29:52 +02:00
|
|
|
value: upend_base::entry::EntryValue::String(String::from($value)),
|
2023-04-02 19:55:51 +02:00
|
|
|
provenance: "SYSTEM INIT".to_string(),
|
|
|
|
timestamp: chrono::Utc::now().naive_utc(),
|
2022-02-02 17:13:23 +01:00
|
|
|
})
|
2021-07-26 23:10:12 +02:00
|
|
|
}};
|
|
|
|
}
|
|
|
|
|
2023-04-20 16:02:41 +02:00
|
|
|
#[macro_export]
|
2021-07-26 23:10:12 +02:00
|
|
|
macro_rules! upend_insert_addr {
|
|
|
|
($db_connection:expr, $entity:expr, $attribute:expr, $addr:expr) => {{
|
2022-02-02 17:13:23 +01:00
|
|
|
$db_connection.insert_entry(Entry {
|
|
|
|
entity: $entity.clone(),
|
|
|
|
attribute: String::from($attribute),
|
2023-06-25 15:29:52 +02:00
|
|
|
value: upend_base::entry::EntryValue::Address($addr.clone()),
|
2023-04-02 19:55:51 +02:00
|
|
|
provenance: "SYSTEM INIT".to_string(),
|
|
|
|
timestamp: chrono::Utc::now().naive_utc(),
|
2022-02-02 17:13:23 +01:00
|
|
|
})
|
2021-07-26 23:10:12 +02:00
|
|
|
}};
|
|
|
|
}
|