diff --git a/sync/streams/overview.mdx b/sync/streams/overview.mdx index 071927e8..88bfe4cd 100644 --- a/sync/streams/overview.mdx +++ b/sync/streams/overview.mdx @@ -45,12 +45,14 @@ Sync Streams will be supported alongside Sync Rules for the foreseeable future, * React hooks: v1.8.0 * Dart: v1.16.0 * Kotlin: v1.7.0 + * .NET: v0.0.9-alpha.1 * Swift: [In progress](https://github.com/powersync-ja/powersync-swift/pull/86). -* Use of the [Rust-based sync client](https://releases.powersync.com/announcements/improved-sync-performance-in-our-client-sdks) - +* Use of the [Rust-based sync client](https://releases.powersync.com/announcements/improved-sync-performance-in-our-client-sdks). The Rust-based sync client is enabled by default on the latest version of all SDKs. If you are on a lower version, follow the instructions below to enable it. + + - In JavaScript SDKs, pass the `clientImplementation` option when connecting: + The Rust client became the default in Web SDK v1.32.0, React Native SDK v1.29.0, Node.js SDK v0.16.0, and Capacitor SDK v0.3.0. For lower versions, pass the `clientImplementation` option when connecting: ```js await db.connect(new MyConnector(), { @@ -61,7 +63,7 @@ Sync Streams will be supported alongside Sync Rules for the foreseeable future, You can migrate back to the JavaScript client later by removing the option. - Pass the `syncImplementation` option when connecting: + The Rust client became the default in Flutter/Dart SDK v1.17.0. Pass the `syncImplementation` option when connecting: ```dart database.connect( @@ -75,7 +77,7 @@ Sync Streams will be supported alongside Sync Rules for the foreseeable future, You can migrate back to the Dart client later by removing the option. - Pass the `newClientImplementation` option when connecting: + The Rust client became the default in Kotlin SDK v1.9.0. For lower versions, pass the `newClientImplementation` option when connecting: ```kotlin //@file:OptIn(ExperimentalPowerSyncAPI::class) @@ -87,7 +89,7 @@ Sync Streams will be supported alongside Sync Rules for the foreseeable future, You can migrate back to the Kotlin client later by removing the option. - Pass the `newClientImplementation` option when connecting: + The Rust client became the default in Swift SDK v1.8.0. For lower versions, pass the `newClientImplementation` option when connecting: ```swift @_spi(PowerSyncExperimental) import PowerSync @@ -99,6 +101,9 @@ Sync Streams will be supported alongside Sync Rules for the foreseeable future, You can migrate back to the Swift client later by removing the option. + + The Rust client was introduced as the default in .NET SDK v0.0.5-alpha.1. No additional configuration is required. + * Sync Stream definitions. They are currently defined in the same YAML file as Sync Rules: `sync_rules.yaml` (PowerSync Cloud) or `config.yaml` (Open Edition/self-hosted). To enable Sync Streams, add the following configuration: @@ -395,6 +400,23 @@ Select your language for specific examples: ``` + + ```csharp + var sub = await db.SyncStream("issues", new Dictionary { { "id", "issue-id" } }) + .Subscribe(new SyncStreamSubscribeOptions { Ttl = TimeSpan.FromHours(1) }); + + // Resolve current status for subscription + var status = db.CurrentStatus.ForStream(sub); + var progress = status?.Progress; + + // Wait for this subscription to have synced + await sub.WaitForFirstSync(); + + // When the component needing the subscription is no longer active... + sub.Unsubscribe(); + ``` + + Coming soon