A complete .NET adapter for Cloudflare D1 database. Provides seamless integration with Cloudflare's serverless SQLite database, supporting both local SQLite development and remote D1 production deployments. Features include query execution, batch operations, time travel queries, and full database management capabilities.
$ dotnet add package CloudflareD1.NETA 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.
dotnet add package CloudflareD1.NET
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"
);
Full documentation is available at https://jdtoon.github.io/CloudflareD1.NET
MIT License - see LICENSE for details