Soenneker.Cloudflare.D1 11.0.39

Prefix Reserved
dotnet add package Soenneker.Cloudflare.D1 --version 11.0.39
                    
NuGet\Install-Package Soenneker.Cloudflare.D1 -Version 11.0.39
                    
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="Soenneker.Cloudflare.D1" Version="11.0.39" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Cloudflare.D1" Version="11.0.39" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Cloudflare.D1" />
                    
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 Soenneker.Cloudflare.D1 --version 11.0.39
                    
#r "nuget: Soenneker.Cloudflare.D1, 11.0.39"
                    
#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 Soenneker.Cloudflare.D1@11.0.39
                    
#: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=Soenneker.Cloudflare.D1&version=11.0.39
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Cloudflare.D1&version=11.0.39
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Cloudflare.D1

A utility library for Cloudflare D1 database operations.

Installation

dotnet add package Soenneker.Cloudflare.D1

Usage

Targets .NET 10. Register the utility and its Cloudflare client dependency:

using Soenneker.Cloudflare.D1.Registrars;

services.AddCloudflareD1UtilAsSingleton();
// AddCloudflareD1UtilAsScoped() is also available.

Inject ICloudflareD1Util from Soenneker.Cloudflare.D1.Abstract. Supply the account ID and Cloudflare API bearer token for each call. Store the token in your secret store; do not embed it in source code. Database reads require D1 Read permission; mutating operations require D1 Write permission.

using Soenneker.Cloudflare.OpenApiClient.Models;

var databases = await d1.ListDatabases(accountId, apiToken,
    page: 1, perPage: 20, cancellationToken: cancellationToken);

var result = await d1.Query(accountId, apiToken, databaseId,
    new D1BatchQuery
    {
        D1SingleQuery = new D1SingleQuery
        {
            Sql = "SELECT * FROM users WHERE name = ?",
            Params = ["Alice"]
        }
    }, cancellationToken);

Use parameters for SQL values. To submit a batch, populate D1BatchQuery.D1BatchQueryMember1 with a D1BatchQueryMember1 whose Batch contains D1SingleQuery objects. Exactly one single-query or batch member must be set. The generated SDK represents query parameters as strings.

Operations

  • ListDatabases: one page of databases with optional name filtering.
  • CreateDatabase, GetDatabase, UpdateDatabase, UpdateDatabasePartial, and DeleteDatabase.
  • Query and QueryRaw: parameterized SQL or batches, returning object rows or raw arrays.
  • ExportDatabase and ImportDatabase: typed requests for the API's export/import stages.
  • GetTimeTravelBookmark and RestoreDatabase: bookmark lookup and database restoration.

Methods return generated Cloudflare response envelopes, including errors, statement results, and pagination metadata. Inspect envelope and per-statement success fields; HTTP/API exceptions and cancellation propagate to the caller. The utility does not automatically paginate, retry mutations, upload import files, poll export/import jobs, or download exports. Delete and restore calls modify the database immediately.

API reference: https://developers.cloudflare.com/api/resources/d1/subresources/database/

Build and test

dotnet build -c Release
dotnet test --project test/Soenneker.Cloudflare.D1.Tests -c Release -- --treenode-filter '/*/*/CloudflareD1UtilTests/*'
dotnet pack src/Soenneker.Cloudflare.D1 -c Release -o artifacts

Tests use an in-memory HTTP handler and do not require Cloudflare credentials or access live databases.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Cloudflare.D1:

Package Downloads
Soenneker.Librarian.D1

Librarian document storage backed by Cloudflare D1 snapshots.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.39 34 10/31/2026
11.0.38 63 10/31/2026
11.0.37 55 10/30/2026
11.0.35 53 10/30/2026
11.0.34 127 10/27/2026
11.0.32 91 10/27/2026
11.0.31 80 10/27/2026
11.0.30 139 10/26/2026
11.0.29 130 10/26/2026
11.0.28 85 10/26/2026
4.0.27 115 10/23/2026
4.0.26 261 10/15/2026
4.0.25 110 10/14/2026
4.0.24 92 10/14/2026
4.0.23 86 10/14/2026
4.0.22 95 10/14/2026
4.0.16 93 10/13/2026
4.0.14 89 10/12/2026
4.0.13 298 10/12/2026
4.0.12 96 10/11/2026
Loading failed

Updated Multiple NuGet packages