Record a copy-up: `source_surrogate` in `target_collection` is now represented by `target_surrogate` in target storage.
(
&self,
target_collection_key: &str,
source_surrogate: u32,
target_surrogate: u32,
)
| 25 | /// Record a copy-up: `source_surrogate` in `target_collection` is now |
| 26 | /// represented by `target_surrogate` in target storage. |
| 27 | pub fn put_clone_copyup( |
| 28 | &self, |
| 29 | target_collection_key: &str, |
| 30 | source_surrogate: u32, |
| 31 | target_surrogate: u32, |
| 32 | ) -> crate::Result<()> { |
| 33 | let txn = self |
| 34 | .db |
| 35 | .begin_write() |
| 36 | .map_err(|e| catalog_err("clone_copyups begin_write", e))?; |
| 37 | { |
| 38 | let mut table = txn |
| 39 | .open_table(CLONE_COPYUPS) |
| 40 | .map_err(|e| catalog_err("open clone_copyups", e))?; |
| 41 | table |
| 42 | .insert((target_collection_key, source_surrogate), target_surrogate) |
| 43 | .map_err(|e| catalog_err("insert clone_copyups", e))?; |
| 44 | } |
| 45 | txn.commit() |
| 46 | .map_err(|e| catalog_err("clone_copyups commit", e)) |
| 47 | } |
| 48 | |
| 49 | /// Look up the target surrogate for a copied-up source row. |
| 50 | /// Returns `None` if no copy-up has been recorded for this surrogate. |