CSharpDB.Storage.Diagnostics 1.2.0

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

CSharpDB.Storage.Diagnostics

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

NuGet License: MIT

Overview

CSharpDB.Storage.Diagnostics provides read-only inspection and integrity verification for CSharpDB database files, WAL files, and indexes. Use it to validate database health, diagnose corruption, inspect page layouts, and verify index consistency. All operations are non-destructive and safe to run on production databases.

Key Types

Type Description
DatabaseInspector Inspects database files: validates headers, walks B+trees, produces page-type histograms, and reports issues
WalInspector Validates WAL files: header checks, frame-by-frame validation (salt, checksums), commit marker detection
IndexInspector Verifies index integrity: root page validity, table/column existence, B+tree reachability
DatabaseInspectReport Report model with header info, page histogram, scanned pages, and issue list

Usage

Database Inspection

using CSharpDB.Storage.Diagnostics;

// Full database inspection
var report = await DatabaseInspector.InspectAsync("mydb.db");

Console.WriteLine($"Pages scanned: {report.PageCountScanned}");
Console.WriteLine($"Issues found: {report.Issues.Count}");

foreach (var issue in report.Issues)
{
    Console.WriteLine($"  [{issue.Severity}] {issue.Message}");
}

// Inspect a specific page
var page = await DatabaseInspector.InspectPageAsync("mydb.db", pageId: 3, includeHex: true);

WAL Inspection

// Validate WAL integrity
var walReport = await WalInspector.InspectAsync("mydb.db");

// Check for frame validation errors, salt mismatches, checksum failures

Index Verification

// Verify an index is consistent with its table
var indexReport = await IndexInspector.CheckAsync("mydb.db", "idx_users_email", sampleSize: 100);

Installation

dotnet add package CSharpDB.Storage.Diagnostics

Dependencies

  • CSharpDB.Core - shared type system
  • CSharpDB.Storage - storage engine types and page format definitions
Package Description
CSharpDB.Storage The storage engine this package inspects
CSharpDB.Service Service layer that exposes diagnostics via API

License

MIT - see LICENSE for details.

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 (1)

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

Package Downloads
CSharpDB.Service

Thread-safe service layer for hosting CSharpDB in ASP.NET Core, Blazor, or MCP server applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 0 3/5/2026
1.1.0 33 3/4/2026