Skip to content

Commit 3fe50e7

Browse files
[Rust] Extend view table accessors with count (#4638)
# Description of Changes Adds `count` to rust's procedural view API. This API already existed in C# and typescript. This patch just adds tests for those module languages. We were already tracking reads for `count`, and so all this patch does is add the new rust module bindings. # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing Smoketests for rust, C#, and typescript.
1 parent 5325644 commit 3fe50e7

17 files changed

Lines changed: 739 additions & 150 deletions

File tree

crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#FFI.verified.cs

Lines changed: 132 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bindings-csharp/Codegen.Tests/fixtures/explicitnames/snapshots/Module#FFI.verified.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,12 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
294294

295295
public static SpacetimeDB.Internal.RawScheduleDefV10? MakeScheduleDesc() => null;
296296

297+
/// <summary>
298+
/// Returns the number of rows in this table.
299+
///
300+
/// This reads datastore metadata, so it runs in constant time.
301+
/// It also takes into account modifications by the current transaction.
302+
/// </summary>
297303
public ulong Count =>
298304
global::SpacetimeDB.Internal.ITableView<DemoTable, global::DemoTable>.DoCount();
299305

@@ -391,6 +397,12 @@ public sealed class DemoTableReadOnly
391397
internal DemoTableReadOnly()
392398
: base("DemoTable") { }
393399

400+
/// <summary>
401+
/// Returns the number of rows in this table.
402+
///
403+
/// This reads datastore metadata, so it runs in constant time.
404+
/// It also takes into account modifications by the current transaction.
405+
/// </summary>
394406
public ulong Count => DoCount();
395407

396408
public sealed class IdIndex

0 commit comments

Comments
 (0)