Turso.Serverless.Client 0.8.0-pre.11

Prefix Reserved
This is a prerelease version of Turso.Serverless.Client.
dotnet add package Turso.Serverless.Client --version 0.8.0-pre.11
                    
NuGet\Install-Package Turso.Serverless.Client -Version 0.8.0-pre.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Turso.Serverless.Client" Version="0.8.0-pre.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Turso.Serverless.Client" Version="0.8.0-pre.11" />
                    
Directory.Packages.props
<PackageReference Include="Turso.Serverless.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Turso.Serverless.Client --version 0.8.0-pre.11
                    
#r "nuget: Turso.Serverless.Client, 0.8.0-pre.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Turso.Serverless.Client@0.8.0-pre.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Turso.Serverless.Client&version=0.8.0-pre.11&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Turso.Serverless.Client&version=0.8.0-pre.11&prerelease
                    
Install as a Cake Tool

Turso.Serverless.Client

Serverless database driver for Turso Cloud using only HttpClient — the .NET counterpart of @tursodatabase/serverless. Connects to a database over the SQL over HTTP protocol with streaming cursor support.

Unlike the Turso and Turso.Data.Sqlite.Provider packages, this is a pure managed HTTP client — it has no native component.

Getting started

using Turso.Serverless.Client;

await using var connection = new TursoServerlessConnection(new TursoServerlessConnectionOptions
{
    Url = Environment.GetEnvironmentVariable("TURSO_DATABASE_URL")!,
    AuthToken = Environment.GetEnvironmentVariable("TURSO_AUTH_TOKEN"),
});

// Query with positional arguments
var users = await connection.ExecuteAsync("SELECT id, name FROM users WHERE active = ?", [1]);
foreach (var row in users.Rows)
{
    Console.WriteLine($"{row.GetInt64("id")}: {row.GetString("name")}");
}

// Write with named arguments
await connection.ExecuteAsync(
    "INSERT INTO users (name, email) VALUES (:name, :email)",
    new Dictionary<string, object?> { [":name"] = "Iku", [":email"] = "iku@example.com" });

// Atomic batch — one round trip, BEGIN/COMMIT/ROLLBACK handled server-side
await connection.BatchAsync(
    [
        new TursoBatchStatement("INSERT INTO logs (msg) VALUES (?)", ["a"]),
        new TursoBatchStatement("INSERT INTO logs (msg) VALUES (?)", ["b"]),
    ],
    TursoBatchMode.Immediate);

// Interactive transaction
await using (var tx = await connection.BeginTransactionAsync(TursoBatchMode.Immediate))
{
    await tx.ExecuteAsync("UPDATE accounts SET balance = balance - 10 WHERE id = ?", [1]);
    await tx.ExecuteAsync("UPDATE accounts SET balance = balance + 10 WHERE id = ?", [2]);
    await tx.CommitAsync();
}

Concurrency model

A TursoServerlessConnection is single-stream: it runs one statement at a time. This follows from the SQL over HTTP protocol, where each request carries a baton from the previous response to sequence operations on the server. Calls made while another is in flight automatically wait for it to finish.

For parallelism, create multiple connections — constructing one is cheap (no HTTP request is sent until the first statement executes) and HttpClient pools the underlying TCP/TLS connections. A shared static HttpClient is used by default; pass your own via the second constructor parameter to integrate with IHttpClientFactory.

Features

  • ExecuteAsync — single statement with positional or named arguments, full result set
  • BatchAsync — multiple statements in one round trip, optionally atomic (TursoBatchMode)
  • SequenceAsync — semicolon-separated statement scripts (schema migrations)
  • DescribeAsync — column/parameter metadata without executing
  • BeginTransactionAsync — interactive transactions (await using, rollback on dispose)
  • InTransaction — authoritative server-side autocommit status
  • Per-call or default query timeouts (TursoTimeoutException), cancellation tokens throughout
  • Encrypted database support via RemoteEncryptionKey (x-turso-encryption-key)

Protocol

The driver speaks the same protocol as the JavaScript serverless driver (serverless/javascript): POST /v3/pipeline for request/response operations and POST /v3/cursor for streamed (newline-delimited JSON) results. Integers map to long, floats to double, text to string, blobs to byte[].

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0-pre.11 40 9/11/2026
0.8.0-pre.7 66 8/21/2026