MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / PreApply

Method PreApply

sdks/csharp/src/Table.cs:432–441  ·  view source on GitHub ↗

Invoked before applying the parsed table update (delta) to this table. This is called for all tables before any updates are applied, allowing OnBeforeDelete callbacks to be triggered for rows that will be removed. Calling the OnBeforeDelete callbacks allows the user to read the old values of the rows that will be removed, before they are actually removed. Should be called before Apply an

(IEventContext context, IParsedTableUpdate parsedTableUpdate)

Source from the content-addressed store, hash-verified

430 /// Should be called before Apply and PostApply.
431 /// </summary>
432 void IRemoteTableHandle.PreApply(IEventContext context, IParsedTableUpdate parsedTableUpdate)
433 {
434 Debug.Assert(wasInserted.Count == 0 && wasUpdated.Count == 0 && wasRemoved.Count == 0, "Call Apply and PostApply before calling PreApply again");
435 if (IsEventTable) return; // Event tables have no deletes.
436 var delta = (ParsedTableUpdate)parsedTableUpdate;
437 foreach (var (_, value) in Entries.WillRemove(delta.Delta))
438 {
439 InvokeBeforeDelete(context, value);
440 }
441 }
442
443 /// <summary>
444 /// Applies the parsed table update (delta) to this table.

Callers

nothing calls this directly

Calls 2

AssertMethod · 0.80
WillRemoveMethod · 0.80

Tested by

no test coverage detected