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

Function assert_row_count

modules/sdk-test-procedure-cpp/src/lib.cpp:101–108  ·  view source on GitHub ↗

Helper function to assert row count

Source from the content-addressed store, hash-verified

99
100// Helper function to assert row count
101void assert_row_count(ProcedureContext& ctx, uint64_t count) {
102 ctx.with_tx([count](TxContext& tx) {
103 uint64_t actual = tx.db[my_table].count();
104 if (actual != count) {
105 LOG_PANIC("Expected " + std::to_string(count) + " rows but got " + std::to_string(actual));
106 }
107 });
108}
109
110// Test transaction that commits
111SPACETIMEDB_PROCEDURE(Unit, insert_with_tx_commit, ProcedureContext ctx) {

Callers 1

SPACETIMEDB_PROCEDUREFunction · 0.70

Calls 3

countMethod · 0.65
to_stringFunction · 0.50
with_txMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…