Unique counter for range key values — avoids collision risk of timestamp modulo.
()
| 393 | |
| 394 | /// Unique counter for range key values — avoids collision risk of timestamp modulo. |
| 395 | fn unique_range() -> i64 { |
| 396 | COUNTER.fetch_add(1, Ordering::SeqCst) as i64 |
| 397 | } |
| 398 | |
| 399 | /// Create an item with appropriate keys for the given table. |
| 400 | pub fn create_item(table_name: &str) -> HashMap<String, AttributeValue> { |