{"record":{"id":"72244df303ee7432","repo":"tursodatabase/turso","slug":"operation-is-not-available-for-direct-remote-or","errorCode":null,"errorMessage":"{operation} is not available for direct remote or embedded replica connections.","messagePattern":"(.+?) is not available for direct remote or embedded replica connections\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.cs","lineNumber":848,"sourceCode":"    {\n        if (_managedConnection is null)\n            throw new NotSupportedException(\"Sync requires an embedded replica connection.\");\n\n        return _managedConnection;\n    }\n\n    private void NotifyManagedStateChange(ConnectionState originalState)\n    {\n        var currentState = State;\n        if (currentState != originalState)\n            OnStateChange(new StateChangeEventArgs(originalState, currentState));\n    }\n\n    private void ThrowIfManagedLocalOnly(string operation)\n    {\n        if (_managedConnection is not null)\n        {\n            throw new NotSupportedException(\n                $\"{operation} is not available for direct remote or embedded replica connections.\");\n        }\n    }\n\n    private void ThrowIfDirectRemote(string operation)\n    {\n        if (IsDirectRemote)\n        {\n            throw new NotSupportedException(\n                $\"{operation} is not available for direct remote connections.\");\n        }\n    }\n\n    private void RegisterManagedReplicaCallbacks()\n    {\n        if (!IsReplica)\n            return;\n","sourceCodeStart":830,"sourceCodeEnd":866,"githubUrl":"https://github.com/tursodatabase/turso/blob/6c7252267988c76e632af00a671e4b9788dfae13/bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.cs#L830-L866","documentation":"Thrown by the ThrowIfManagedLocalOnly guard: the named operation is only meaningful for local (non-managed) database files, but this connection is backed by a managed TursoConnection (an embedded replica or direct remote). The operation name is interpolated into the message; the faulting input is the connection mode, not any argument to the operation.","triggerScenarios":"Thrown at bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.cs:848 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a plain local SQLite/Turso file connection (no sync URL) for this operation","Perform the equivalent operation through the managed Turso API surface instead of the local-only ADO.NET method","Check the connection configuration before invoking operations that only apply to local databases"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c7252267988c76e632af00a671e4b9788dfae13","analyzedAt":"2026-09-06T07:15:26.990Z","contentChangedAt":"2026-09-06T07:15:26.990Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}