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

Method TableIndex

crates/bindings-csharp/Codegen/Module.cs:356–371  ·  view source on GitHub ↗

Primary constructor that initializes all fields. Other constructors delegate to this one to avoid code duplication. Name to use when accessing this index. If null, will be generated from column names. Explicit canonical name override for this index, if any. The columns that make up thi

(
        string? accessorName,
        string? canonicalName,
        ImmutableArray<ColumnRef> columns,
        string? tableName,
        TableIndexType type
    )

Source from the content-addressed store, hash-verified

354 /// <param name="tableName">The name of the table this index belongs to, if any.</param>
355 /// <param name="type">The type of index (currently only B-tree is supported).</param>
356 private TableIndex(
357 string? accessorName,
358 string? canonicalName,
359 ImmutableArray<ColumnRef> columns,
360 string? tableName,
361 TableIndexType type
362 )
363 {
364 Columns = new(columns);
365 Table = tableName;
366 var columnNames = string.Join("_", columns.Select(c => c.Name));
367 AccessorName = accessorName ?? columnNames;
368 CanonicalName = canonicalName;
369 Type = type;
370 StandardNameSuffix = $"_{columnNames}_idx_{Type.ToString().ToLower()}";
371 }
372
373 /// <summary>
374 /// Creates a B-tree index on a single column with auto-generated name.

Callers

nothing calls this directly

Calls 4

GetColumnIndexMethod · 0.80
ReportMethod · 0.80
ToStringMethod · 0.45
WhereMethod · 0.45

Tested by

no test coverage detected