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

Method Decode

sdks/csharp/src/Table.cs:257–268  ·  view source on GitHub ↗

Decode a row for a table, producing a primary key. If the table has a specific column marked `#[primary_key]`, use that. If not, the BSATN for the entire row is used instead.

(BinaryReader reader, out object primaryKey)

Source from the content-addressed store, hash-verified

255 /// <param name="primaryKey"></param>
256 /// <returns></returns>
257 public Row Decode(BinaryReader reader, out object primaryKey)
258 {
259 var obj = DecodeValue(reader);
260
261 // TODO(1.1): we should exhaustively check that GenericEqualityComparer works
262 // for all types that are allowed to be primary keys.
263 var primaryKey_ = GetPrimaryKey(obj);
264 primaryKey_ ??= obj;
265 primaryKey = primaryKey_;
266
267 return obj;
268 }
269
270 /// <summary>
271 /// Creates and returns a parsed table update for the current table.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected