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

Function SPACETIMEDB_VIEW

modules/sdk-test-view-cpp/src/lib.cpp:135–138  ·  view source on GitHub ↗

View: my_player - Returns the player for the caller

Source from the content-addressed store, hash-verified

133
134// View: my_player - Returns the player for the caller
135SPACETIMEDB_VIEW(std::optional<Player>, my_player, Public, ViewContext ctx) {
136 auto player_opt = ctx.db[player_identity].find(ctx.sender());
137 return player_opt;
138}
139
140// View: my_player_and_level - Returns player with level joined
141SPACETIMEDB_VIEW(std::optional<PlayerAndLevel>, my_player_and_level, Public, ViewContext ctx) {

Callers

nothing calls this directly

Calls 5

push_backMethod · 0.80
filterMethod · 0.65
findMethod · 0.45
senderMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…