The SDK exposes the capabilities of the active transport as a set of SurrealFeature values, and the lifecycle of the connection as a stream of SurrealConnectionEvent.
Source: surrealdb.kotlin
SurrealFeature
An enum of the features a transport may support. Inspect the active set via the features property, or check a single feature with .supports().
| Value | Available on |
|---|---|
LiveQueries | WebSocket |
Transactions | WebSocket |
Sessions | WebSocket |
RefreshTokens | WebSocket |
ExportImport | WebSocket, HTTP |
SurrealML | WebSocket, HTTP |
SurrealConnectionEvent
A sealed class emitted on the client's connectionEvents SharedFlow.
| Variant | Payload | Description |
|---|---|---|
Connecting | — | A connection attempt has started. |
Connected | — | The connection is established. |
Disconnected | — | The connection has dropped. |
Reconnecting | attempt: Int, delayMillis: Long | A reconnect is scheduled. |
Error | cause: Throwable | A connection error occurred. |