(ISubscriptionHandle handle, string[] querySqls)
| 894 | } |
| 895 | |
| 896 | QuerySetId? IDbConnection.Subscribe(ISubscriptionHandle handle, string[] querySqls) |
| 897 | { |
| 898 | if (!webSocket.IsConnected) |
| 899 | { |
| 900 | Log.Error("Cannot subscribe, not connected to server!"); |
| 901 | return null; |
| 902 | } |
| 903 | |
| 904 | var id = stats.SubscriptionRequestTracker.StartTrackingRequest(); |
| 905 | // We use a distinct ID from the request ID as a sanity check that we're not |
| 906 | // casting request IDs to query IDs anywhere in the new code path. |
| 907 | var querySetId = querySetIdAllocator.Next(); |
| 908 | subscriptions[querySetId] = handle; |
| 909 | webSocket.Send(new ClientMessage.Subscribe( |
| 910 | new Subscribe |
| 911 | { |
| 912 | RequestId = id, |
| 913 | QuerySetId = new QuerySetId(querySetId), |
| 914 | QueryStrings = querySqls.ToList(), |
| 915 | } |
| 916 | )); |
| 917 | return new QuerySetId(querySetId); |
| 918 | } |
| 919 | |
| 920 | /// Usage: SpacetimeDBClientBase.instance.OneOffQuery<Message>("SELECT * FROM table WHERE sender = \"bob\""); |
| 921 | [Obsolete("This is replaced by ctx.Db.TableName.RemoteQuery(\"WHERE ...\")", false)] |
nothing calls this directly
no test coverage detected