CSharpDB.Client
2.5.0
Prefix Reserved
See the version list below for details.
dotnet add package CSharpDB.Client --version 2.5.0
NuGet\Install-Package CSharpDB.Client -Version 2.5.0
<PackageReference Include="CSharpDB.Client" Version="2.5.0" />
<PackageVersion Include="CSharpDB.Client" Version="2.5.0" />
<PackageReference Include="CSharpDB.Client" />
paket add CSharpDB.Client --version 2.5.0
#r "nuget: CSharpDB.Client, 2.5.0"
#:package CSharpDB.Client@2.5.0
#addin nuget:?package=CSharpDB.Client&version=2.5.0
#tool nuget:?package=CSharpDB.Client&version=2.5.0
CSharpDB.Client
CSharpDB.Client is the authoritative database API for CSharpDB.
It owns the public client contract used to talk to a database, while transport and lower-level implementation details stay behind that boundary.
Current Direction
CSharpDB.Clientis now the real implementation layer for database access.Direct,Http, andGrpcare implemented transports today.NamedPipesremains the only future transport target.
Current Transport Model
Create the client with CSharpDbClientOptions:
var client = CSharpDbClient.Create(new CSharpDbClientOptions
{
Transport = CSharpDbTransport.Direct,
DataSource = "csharpdb.db",
HybridDatabaseOptions = new HybridDatabaseOptions
{
PersistenceMode = HybridPersistenceMode.IncrementalDurable,
HotTableNames = ["users"],
HotCollectionNames = ["session_cache"]
},
DirectDatabaseOptions = new DatabaseOptions()
});
The transport can be selected explicitly with Transport. If it is omitted, the client infers it from Endpoint and otherwise defaults to direct.
Direct resolution currently accepts:
Endpointas a file pathEndpointasfile://...DataSourceConnectionStringcontainingData Source=...- optional
HybridDatabaseOptionsfor the lazy-resident hybrid direct mode - optional
DirectDatabaseOptionsfor direct transport engine/pager tuning
Resolution rules:
- direct is the default when transport cannot be inferred from a network endpoint
- supplied direct inputs must resolve to the same target
HybridDatabaseOptionsis supported only for direct transport and is rejected forHttp,Grpc, andNamedPipesDirectDatabaseOptionsis supported only for direct transport and is rejected forHttp,Grpc, andNamedPipeshttp://andhttps://inferHttpunlessTransport = CSharpDbTransport.Grpcis set explicitlypipe://andnpipe://inferNamedPipesGrpcuseshttp://orhttps://endpoints and talks toCSharpDB.DaemonHttpuseshttp://orhttps://endpoints and talks toCSharpDB.ApiNamedPipesstill validates its endpoint shape and then fails with a not-implemented errorHttpClientis supported for bothHttpandGrpc
Use HybridDatabaseOptions when the direct client should run with a lazy
resident page cache while persisting committed state back to the resolved file
path. Typical patterns are:
- default
IncrementalDurablefor durable hybrid direct usage with on-demand page warming IncrementalDurableplusHotTableNames/HotCollectionNameswhen selected read-mostly objects should be preloaded into the hybrid cache at openSnapshotplusDisposewhen the process wants explicit full-image export behavior on closeSnapshotplusNonewhen the process will callSaveToFileAsync(...)manually
Hot-set warming is a hybrid-only runtime hint. In v1 it:
- warms SQL table B+trees plus SQL secondary indexes
- warms collection backing tables only
- is supported only for
IncrementalDurable - requires the default unbounded pager cache and is rejected for bounded/custom cache setups
Use DirectDatabaseOptions when the in-process engine should open with explicit
storage tuning. Typical patterns are:
UseDirectLookupOptimizedPreset()for hot local direct workloadsUseDirectColdFileLookupPreset()for cache-pressured direct file readsUseHybridFileCachePreset()only for explicit bounded file-cache experiments
Remote transports do not accept either direct-only property because those settings must be configured on the host process instead.
Example HTTP selection:
var client = CSharpDbClient.Create(new CSharpDbClientOptions
{
Transport = CSharpDbTransport.Http,
Endpoint = "http://localhost:61818"
});
This resolves to the dedicated CSharpDB.Api REST host.
Example gRPC selection:
var client = CSharpDbClient.Create(new CSharpDbClientOptions
{
Transport = CSharpDbTransport.Grpc,
Endpoint = "https://localhost:5001"
});
This resolves to the dedicated CSharpDB.Daemon gRPC host.
Supported Surface
The current ICSharpDbClient includes:
- database info and data source metadata
- tables, schemas, row counts, browse, and primary-key lookup
- row insert, update, and delete
- table and column DDL
- indexes, views, and triggers
- saved queries
- procedures and procedure execution
- SQL execution with multi-statement splitting
- client-managed transaction sessions
- document collections
- checkpoint
- storage diagnostics
Implementation Notes
- The direct client depends on
CSharpDB.Engine,CSharpDB.Sql, andCSharpDB.Storage.Diagnostics. CSharpDB.Clientdoes not referenceCSharpDB.Data.- The HTTP transport runs against
CSharpDB.Apiand now covers the same publicICSharpDbClientsurface as the direct client. - The gRPC transport uses generated protobuf RPC methods, not a generic JSON tunnel.
- Dynamic values such as row cells, procedure args, and collection documents are carried through a recursive protobuf value contract that preserves blobs and nested objects.
- The direct transport talks to the engine in-process, the HTTP transport uses JSON endpoints, and the gRPC transport uses the dedicated daemon host.
- Internal tables such as
__procedures,__saved_queries, and collection backing tables are hidden from normal table listing.
Dependency Injection
services.AddCSharpDbClient(new CSharpDbClientOptions
{
DataSource = "csharpdb.db"
});
or
services.AddCSharpDbClient(sp => new CSharpDbClientOptions
{
ConnectionString = "Data Source=csharpdb.db"
});
Design Rule
New database-facing functionality should be added here first.
Host-specific concerns should not create a second authoritative API beside CSharpDB.Client.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- CSharpDB.Engine (>= 2.5.0)
- CSharpDB.Pipelines (>= 2.5.0)
- CSharpDB.Sql (>= 2.5.0)
- CSharpDB.Storage.Diagnostics (>= 2.5.0)
- Google.Protobuf (>= 3.34.0)
- Grpc.Net.Client (>= 2.76.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on CSharpDB.Client:
| Package | Downloads |
|---|---|
|
CSharpDB
All-in-one package for CSharpDB application development. Includes the unified client, engine, ADO.NET provider, and diagnostics. |
|
|
CSharpDB.Service
Deprecated compatibility facade over CSharpDB.Client for existing hosts. Planned for removal in v2.0.0. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 91 | 4/8/2026 |
| 2.9.1 | 84 | 4/7/2026 |
| 2.8.1 | 87 | 4/6/2026 |
| 2.8.0 | 86 | 4/4/2026 |
| 2.7.0 | 97 | 3/31/2026 |
| 2.6.0 | 89 | 3/29/2026 |
| 2.5.0 | 185 | 3/28/2026 |
| 2.4.0 | 88 | 3/24/2026 |
| 2.3.0 | 86 | 3/22/2026 |
| 2.2.0 | 87 | 3/21/2026 |
| 2.0.1 | 96 | 3/14/2026 |
| 2.0.0 | 87 | 3/13/2026 |
| 1.9.0 | 106 | 3/12/2026 |
| 1.8.0 | 108 | 3/11/2026 |
| 1.7.0 | 105 | 3/8/2026 |