DBDelve
DBDelve는 Rust 기반 빠른 다중 엔진 데이터베이스 클라이언트, 무료 오픈소스, 텔레메트리 없음
A source-generated, Native AOT-compatible REST client for .NET 10+. Define your HTTP API as a C# interface — the Roslyn generator emits a fully type-safe, zero-reflection implementation at compile time.
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Describe your HTTP API as a C# interface and get a typed REST client generated at compile time: a Refit alternative with no reflection, NativeAOT-ready, and no allocation beyond what the same call written by hand costs.
HttpClient code does. A generated GET of a small DTO allocates 1,688 B per call, the same as the request written by hand, and a test fails the build if it ever allocates more.DynamicMethod; CI publishes a NativeAOT app and fails on any trim or AOT warning.Result error type with no mapper, is a compiler diagnostic.dotnet add package ZeroAlloc.Rest
dotnet add package ZeroAlloc.Rest.DependencyInjection
dotnet add package ZeroAlloc.Rest.SystemTextJson
The source generator ships inside ZeroAlloc.Rest. The other two give you the IHttpClientFactory registration and the JSON serializer used below.
Every runtime package targets net8.0, net10.0 and net11.0. Build with the .NET 10 SDK or newer, whose compiler the source generator needs, whichever of the three your project targets. A project that targets net11.0 needs the .NET 11 SDK. On net8.0, ZeroAlloc.Rest.SystemTextJson brings the System.Text.Json 10 package, so both targets serialize alike.
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.Extensions.DependencyInjection;
using ZeroAlloc.Rest.Attributes;
using ZeroAlloc.Rest.SystemTextJson;
var services = new ServiceCollection();
services.AddIUserApi(options => // generated from the interface name
{
options.BaseAddress = new Uri("https://jsonplaceholder.typicode.com");
options.UseSerializer(new SystemTextJsonSerializer(AppJsonContext.Default));
});
var api = services.BuildServiceProvider().GetRequiredService<IUserApi>();
var user = await api.GetUserAsync(1);
Console.WriteLine($"{user.Id}: {user.Name}"); // 1: Leanne Graham
[ZeroAllocRestClient]
public interface IUserApi
{
[Get("/users/{id}")]
Task<UserDto> GetUserAsync(int id, CancellationToken ct = default);
}
public sealed record UserDto(int Id, string Name);
[JsonSourceGenerationOptions(JsonSerializerDefaults.Web)]
[JsonSerializable(typeof(UserDto))]
internal sealed partial class AppJsonContext : JsonSerializerContext;
The generator writes UserApiClient, a sealed class implementing IUserApi, at compile time. Inject IUserApi wherever you need it.
{**path} catch-alls, [Query], [Body] and [Header].Result<T, HttpError> from ZeroAlloc.Results and 4xx/5xx responses, network failures and timeouts come back as a failure instead of an exception, or map them to your own error type.HttpClient makes by default.IHttpClientFactory integration through a generated Add{Interface} extension, or construct the client by hand without DI.ActivitySource and Meter, ready for OpenTelemetry: Telemetry.zeroalloc generate CLI or an MSBuild item: OpenAPI code generation.ZeroAlloc.Rest.Resilience and ZeroAlloc.Resilience: Resilience.ZeroAlloc.Rest.Anthropic for the Anthropic Messages API, with streaming, tools and prompt caching, and ZeroAlloc.Rest.Ollama for Ollama embeddings: Anthropic, Ollama.Against Refit 16.4, in-memory handler, no network I/O. .NET 10.0.13, BenchmarkDotNet v0.15.8. Allocations are exact; speed is a same-run ratio.
| Call | ZA vs Refit | Refit alloc | ZA alloc |
|---|---|---|---|
| GET | 1.5× faster | 2,056 B | 1,584 B |
| GET with query parameter | 2.0× faster | 2,128 B | 1,616 B |
| POST | 1.3× faster | 2,816 B | 2,088 B |
Refit scans attributes with reflection and invokes expression trees on every call; the generated client is plain code. Raw HttpClient rows, DELETE, Result<T>, serializer throughput and the per-call allocation breakdown: docs/benchmarks.md.