CloudflareD1.NET 1.12.0

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

CloudflareD1.NET

NuGet License: MIT

A complete .NET adapter for Cloudflare D1 - the serverless SQL database running on Cloudflare's edge network. This library provides seamless integration with Cloudflare's D1 database, supporting both local SQLite development and remote D1 production deployments.

Features

  • Dual Mode Support: Seamlessly switch between local SQLite (development) and remote D1 (production)
  • Full CRUD Operations: Execute queries, inserts, updates, deletes, and batch operations
  • Parameterized Queries: Prevent SQL injection with built-in parameter binding
  • Time Travel Queries: Query historical data with D1's time travel capabilities
  • Database Management: Create, list, and query database metadata
  • Type-Safe: Strongly typed models and response objects
  • Async/Await: Full async support throughout the library
  • Comprehensive Error Handling: Detailed exception types for different error scenarios
  • Well Tested: 183 unit tests ensuring reliability

Installation

dotnet add package CloudflareD1.NET

Quick Start

using CloudflareD1.NET;

// Configure for remote D1 (production)
var config = new D1Configuration
{
    AccountId = "your-account-id",
    DatabaseId = "your-database-id",
    ApiToken = "your-api-token"
};

var client = new D1Client(config);

// Execute a query
var result = await client.QueryAsync<User>("SELECT * FROM users WHERE id = ?", 1);

// Insert data
await client.ExecuteAsync(
    "INSERT INTO users (name, email) VALUES (?, ?)",
    "John Doe",
    "john@example.com"
);

Documentation

Full documentation is available at https://jdtoon.github.io/CloudflareD1.NET

License

MIT License - see LICENSE for details

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on CloudflareD1.NET:

Package Downloads
CloudflareD1.NET.Linq

LINQ query builder and object mapping extensions for CloudflareD1.NET. Provides CompiledQuery for 95% faster repeated query execution with automatic expression tree caching, IQueryable<T> with deferred execution, async streaming with IAsyncEnumerable<T> for memory-efficient result processing, Set Operations (Union, UnionAll, Intersect, Except), Distinct() for removing duplicates, Contains()/IN clause for collection filtering, Join operations (INNER JOIN, LEFT JOIN), Having clause for filtered aggregations, GroupBy with aggregations (Count, Sum, Average, Min, Max), type-safe query construction with expression trees, Select() projection with computed properties, entity mapping, and fluent API for building SQL queries using lambda expressions. All query methods support CancellationToken.

CloudflareD1.NET.CodeFirst

Code-First ORM for CloudflareD1.NET. Define your database schema using C# classes and attributes, with automatic migration generation. Includes DbContext pattern, entity relationships, and model-driven development similar to Entity Framework Core but optimized for Cloudflare D1 and SQLite.

CloudflareD1.NET.Migrations

Database migration support for CloudflareD1.NET. Provides schema versioning, migration tracking, and fluent API for defining database changes. Works with both local SQLite and remote Cloudflare D1 databases.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.12.0 264 10/28/2025
1.11.3 171 10/28/2025
1.11.2 328 10/27/2025
1.11.1 205 10/27/2025
1.0.2 732 10/26/2025
1.0.2-beta 156 10/26/2025
1.0.1 128 10/25/2025

v1.12.0: Minor release updating documentation (Docs v2.0), stability improvements, and housekeeping. v1.11.3: Production-ready features - Health check API (CheckHealthAsync), automatic retry with exponential backoff for transient failures (429, 503), enhanced structured logging with query duration and metadata. v1.11.2: Documentation improvements. v1.11.1: Removed transaction features requiring Workers-only API support. 296 tests passing.