tursodatabase/turso · error · NotSupportedException

{operation} is not available for direct remote connections.

Error message

{operation} is not available for direct remote connections.

What it means

Thrown by the ThrowIfDirectRemote guard when the requested operation is invoked on a connection whose IsDirectRemote flag is true, meaning it talks straight to a remote server with no local database file. The operation name is interpolated into the message; the unsupported input is the direct-remote connection mode itself.

Source

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

        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;

        using var syncOperation = ManagedConnection.EnterSyncOperation();
        RegisterScalarFunctions();
        RegisterAggregateFunctions();
        RegisterCollations();
    }

    private void ApplyConnectionOptions()
    {
        if (_connectionOptions.ForeignKeys.HasValue)

View on GitHub (pinned to 6c72522679)

Solutions

  1. Use an embedded replica or local file connection instead of a direct remote URL for this operation
  2. Reconfigure the connection string to point at a local database file with optional sync
  3. Route the operation through an API that is supported over remote connections
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.cs:857 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/cff53a41d1a21f60. Report an issue: GitHub.