MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / update

Method update

nodedb-columnar/src/mutation/write.rs:206–222  ·  view source on GitHub ↗

Update a row by PK: DELETE old + INSERT new. `updates` maps column names to new values. Columns not in the map retain their existing values from the old row. Returns WAL records for both the delete and the insert. NOTE: The caller must provide the full old row values for the re-insert. This method takes the complete new row (already merged with old values).

(
        &mut self,
        old_pk: &Value,
        new_values: &[Value],
    )

Source from the content-addressed store, hash-verified

204 /// NOTE: The caller must provide the full old row values for the re-insert.
205 /// This method takes the complete new row (already merged with old values).
206 pub fn update(
207 &mut self,
208 old_pk: &Value,
209 new_values: &[Value],
210 ) -> Result<MutationResult, ColumnarError> {
211 // Delete the old row.
212 let delete_result = self.delete(old_pk)?;
213
214 // Insert the new row.
215 let insert_result = self.insert(new_values)?;
216
217 // Combine WAL records.
218 let mut wal_records = delete_result.wal_records;
219 wal_records.extend(insert_result.wal_records);
220
221 Ok(MutationResult { wal_records })
222 }
223}

Callers 11

update_rowFunction · 0.45
compute_hmacFunction · 0.45
fold_remote_hlcMethod · 0.45
issue_token_bytesFunction · 0.45
verify_tokenFunction · 0.45
seal_bundleFunction · 0.45
open_bundleFunction · 0.45
ca_fingerprintFunction · 0.45
addr_hashFunction · 0.45
compute_hmacFunction · 0.45
verify_hmacFunction · 0.45

Calls 3

deleteMethod · 0.45
insertMethod · 0.45
extendMethod · 0.45

Tested by 1

update_rowFunction · 0.36