{"record":{"id":"1112ff450d0f486e","repo":"tursodatabase/turso","slug":"automatic-sync-is-not-supported-for-embedded-repli","errorCode":null,"errorMessage":"Automatic sync is not supported for embedded replica connections yet. Set Sync Interval=0 and call SyncAsync explicitly.","messagePattern":"Automatic sync is not supported for embedded replica connections yet\\. Set Sync Interval=0 and call SyncAsync explicitly\\.","errorType":"validation","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoConnection.cs","lineNumber":505,"sourceCode":"                ? null\n                : _connectionOptions.PushOperationsThreshold,\n            PullBytesThreshold = _connectionOptions.PullBytesThreshold == 0\n                ? null\n                : _connectionOptions.PullBytesThreshold,\n            ForceLogicalMvccPull = _connectionOptions.ForceLogicalMvccPull,\n            ExperimentalFeatures = string.IsNullOrWhiteSpace(_connectionOptions.SyncExperimentalFeatures)\n                ? null\n                : _connectionOptions.SyncExperimentalFeatures,\n            HttpClient = SyncHttpClientFactory?.Invoke(),\n        };\n    }\n\n    private void ValidateReplicaOptions()\n    {\n        if (_connectionOptions.Pooling)\n            throw new NotSupportedException(\"Pooling is not supported for embedded replica connections yet. Set Pooling=False.\");\n        if (_connectionOptions.SyncInterval != 0)\n            throw new NotSupportedException(\"Automatic sync is not supported for embedded replica connections yet. Set Sync Interval=0 and call SyncAsync explicitly.\");\n    }\n\n    private void ValidateLocalOnlyOptions()\n    {\n        if (!string.IsNullOrWhiteSpace(_connectionOptions.AuthToken))\n            throw new InvalidOperationException(\"Auth Token requires a remote Turso URL Data Source.\");\n        if (!string.IsNullOrWhiteSpace(_connectionOptions.ReplicaPath))\n            throw new InvalidOperationException(\"Replica Path requires a remote Turso URL Data Source.\");\n        if (_connectionOptions.SyncInterval > 0)\n            throw new InvalidOperationException(\"Sync Interval requires a remote embedded replica connection.\");\n        if (_connectionOptions.HasAdvancedReplicaOptions)\n            throw new InvalidOperationException(\"Advanced sync options require a remote embedded replica connection.\");\n        if (_connectionOptions.Tls.HasValue)\n            throw new InvalidOperationException(\"Tls requires a remote Turso URL Data Source.\");\n    }\n\n    private void CloseRemote()\n    {","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/tursodatabase/turso/blob/c1e59287258d99b309e362a63f48822256e2f65f/bindings/dotnet/src/Turso.Data/TursoConnection.cs#L487-L523","documentation":"Automatic background sync on an interval is not implemented for embedded replica connections in the .NET Turso driver. ValidateReplicaOptions() throws NotSupportedException when a non-zero 'Sync Interval' is set, telling you to drive syncs manually with SyncAsync().","triggerScenarios":"Opening an embedded replica connection (OpenReplica/OpenReplicaAsync) with 'Sync Interval' set to any value other than 0 in the connection string.","commonSituations":"Porting code that relied on automatic sync intervals in another SDK; copying a connection string that tuned sync frequency for an environment where this driver never had the feature.","solutions":["Set 'Sync Interval=0' in the connection string.","Call SyncAsync() on the connection explicitly at the points where you need fresh remote data (e.g. on startup or on a timer you own).","If automatic sync is essential, use a driver/platform that supports it (e.g. the Rust SDK with sync interval) or wait for .NET support."],"exampleFix":"// before\n\"Data Source=app.db;Replica Path=app.db;Sync Interval=60\"\n// after\n\"Data Source=app.db;Replica Path=app.db;Sync Interval=0\"\n// and drive it yourself:\nawait connection.SyncAsync();","handlingStrategy":"validation","validationCode":"if (new TursoConnectionOptions(cs).SyncInterval != 0)\n    throw new ArgumentException(\"Set Sync Interval=0 for embedded replicas and call SyncAsync explicitly.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Own your sync cadence: a CancellationToken-driven timer calling SyncAsync().","Document in team config that Sync Interval must be 0 for the .NET driver."],"tags":["dotnet","embedded-replica","sync","connection-string"],"backgroundTag":"automatic-sync-unsupported","analyzedSha":"c1e59287258d99b309e362a63f48822256e2f65f","analyzedAt":"2026-08-31T11:17:35.598Z","contentChangedAt":"2026-08-31T11:17:35.598Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}