tursodatabase/turso · error · NotSupportedException

{operation} is not available for direct remote or embedded r

Error message

{operation} is not available for direct remote or embedded replica connections.

What it means

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.

Source

Thrown at bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.cs:848

    {
        if (_managedConnection is null)
            throw new NotSupportedException("Sync requires an embedded replica connection.");

        return _managedConnection;
    }

    private void NotifyManagedStateChange(ConnectionState originalState)
    {
        var currentState = State;
        if (currentState != originalState)
            OnStateChange(new StateChangeEventArgs(originalState, currentState));
    }

    private void ThrowIfManagedLocalOnly(string operation)
    {
        if (_managedConnection is not null)
        {
            throw new NotSupportedException(
                $"{operation} is not available for direct remote or embedded replica connections.");
        }
    }

    private void ThrowIfDirectRemote(string operation)
    {
        if (IsDirectRemote)
        {
            throw new NotSupportedException(
                $"{operation} is not available for direct remote connections.");
        }
    }

    private void RegisterManagedReplicaCallbacks()
    {
        if (!IsReplica)
            return;

View on GitHub (pinned to 6c72522679)

Solutions

  1. Use a plain local SQLite/Turso file connection (no sync URL) for this operation
  2. Perform the equivalent operation through the managed Turso API surface instead of the local-only ADO.NET method
  3. Check the connection configuration before invoking operations that only apply to local databases
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.cs:848 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tursodatabase/turso@6c72522679 (2026-09-06). Data as JSON: /api/errors/72244df303ee7432. Report an issue: GitHub.