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

Function OnConnected

templates/basic-cs/Program.cs:42–54  ·  view source on GitHub ↗
(DbConnection conn, Identity identity, string authToken)

Source from the content-addressed store, hash-verified

40}
41
42void OnConnected(DbConnection conn, Identity identity, string authToken)
43{
44 Console.WriteLine($"Connected to {DB_NAME}");
45 Console.WriteLine($"Identity: {identity}");
46
47 // Save credentials for future sessions
48 AuthToken.SaveToken(authToken);
49
50 // Subscribe to all tables to receive updates
51 conn.SubscriptionBuilder()
52 .OnApplied(OnSubscriptionApplied)
53 .SubscribeToAllTables();
54}
55
56void OnConnectError(Exception e)
57{

Callers

nothing calls this directly

Calls 4

SaveTokenMethod · 0.45
SubscribeToAllTablesMethod · 0.45
OnAppliedMethod · 0.45
SubscriptionBuilderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…