CSharpDB.Storage 1.7.0

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

CSharpDB.Storage

CSharpDB.Storage is the page-oriented durability layer used by the CSharpDB embedded database engine. It owns:

  • physical file I/O through IStorageDevice
  • page caching and dirty tracking through Pager
  • write-ahead logging and crash recovery through WriteAheadLog
  • row-id keyed B+trees for table and index storage
  • schema metadata persistence through SchemaCatalog

This package is usually consumed indirectly through CSharpDB.Engine, but it also supports direct low-level use for tooling, diagnostics, and storage experiments.

Most users: configure storage through Database

If you are using SQL or the engine layer, customize storage like this:

using CSharpDB.Engine;
using CSharpDB.Storage.Checkpointing;
using CSharpDB.Storage.Paging;

var options = new DatabaseOptions()
    .ConfigureStorageEngine(builder =>
    {
        builder.UsePagerOptions(new PagerOptions
        {
            MaxCachedPages = 2048,
            CheckpointPolicy = new FrameCountCheckpointPolicy(500),
        });

        builder.UseCachingBTreeIndexes(findCacheCapacity: 4096);
    });

await using var db = await Database.OpenAsync("app.cdb", options);

Low-level use: open the storage graph directly

If you need direct access to Pager, SchemaCatalog, or BTree, use the default storage engine factory:

using CSharpDB.Storage.BTrees;
using CSharpDB.Storage.Paging;
using CSharpDB.Storage.StorageEngine;

var storageOptions = new StorageEngineOptionsBuilder()
    .UsePagerOptions(new PagerOptions { MaxCachedPages = 1024 })
    .UseBTreeIndexes()
    .Build();

var factory = new DefaultStorageEngineFactory();
var context = await factory.OpenAsync("lowlevel.cdb", storageOptions);
await using var pager = context.Pager;

await pager.BeginTransactionAsync();
try
{
    uint rootPageId = await BTree.CreateNewAsync(pager);
    var tree = new BTree(pager, rootPageId);

    await tree.InsertAsync(1, new byte[] { 1, 2, 3, 4 });
    byte[]? payload = await tree.FindAsync(1);

    await pager.CommitAsync();
}
catch
{
    await pager.RollbackAsync();
    throw;
}

Key extension points

  • IStorageDevice for alternate storage backends
  • IPageCache through PagerOptions.PageCacheFactory
  • ICheckpointPolicy for auto-checkpoint decisions
  • IPageOperationInterceptor for diagnostics and fault injection
  • IPageChecksumProvider for WAL checksum behavior
  • IIndexProvider for index-store composition
  • ISerializerProvider for record and schema serialization
  • ICatalogStore for catalog payload encoding
  • IStorageEngineFactory for replacing the default storage composition root
Package Description
CSharpDB.Engine SQL/engine layer built on this storage package
CSharpDB.Storage.Diagnostics Read-only inspection and integrity tooling
CSharpDB.Execution Query execution layer that reads/writes through storage

Installation

dotnet add package CSharpDB.Storage

For the all-in-one package:

dotnet add package CSharpDB
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on CSharpDB.Storage:

Package Downloads
CSharpDB.Engine

Lightweight embedded SQL database engine for .NET. Single-file storage, WAL durability, concurrent readers, and a typed Collection<T> NoSQL API.

CSharpDB.Execution

Query planner, operator tree, and expression evaluator for the CSharpDB embedded database.

CSharpDB.Storage.Diagnostics

Read-only storage diagnostics toolkit for CSharpDB database and WAL files.

CSharpDB

All-in-one package for CSharpDB application development. Includes the unified client, engine, ADO.NET provider, service layer, and diagnostics.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.7.0 42 3/8/2026
1.6.0 45 3/8/2026
1.5.0 48 3/7/2026
1.4.0 43 3/7/2026
1.3.0 50 3/6/2026
1.2.0 58 3/5/2026
1.1.0 87 3/4/2026
1.0.0 100 3/1/2026