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
<PackageReference Include="CSharpDB.Storage.Diagnostics" Version="1.2.0" />
<PackageVersion Include="CSharpDB.Storage.Diagnostics" Version="1.2.0" />
<PackageReference Include="CSharpDB.Storage.Diagnostics" />
paket add CSharpDB.Storage.Diagnostics --version 1.2.0
#r "nuget: CSharpDB.Storage.Diagnostics, 1.2.0"
#:package CSharpDB.Storage.Diagnostics@1.2.0
#addin nuget:?package=CSharpDB.Storage.Diagnostics&version=1.2.0
#tool nuget:?package=CSharpDB.Storage.Diagnostics&version=1.2.0
CSharpDB.Storage.Diagnostics
Read-only storage diagnostics and integrity checking toolkit for CSharpDB database files.
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 systemCSharpDB.Storage- storage engine types and page format definitions
Related Packages
| 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 | 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.Core (>= 1.2.0)
- CSharpDB.Storage (>= 1.2.0)
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.