DimonSmart.DbSketch
0.1.3
Prefix Reserved
See the version list below for details.
dotnet tool install --global DimonSmart.DbSketch --version 0.1.3
dotnet new tool-manifest
dotnet tool install --local DimonSmart.DbSketch --version 0.1.3
#tool dotnet:?package=DimonSmart.DbSketch&version=0.1.3
nuke :add-package DimonSmart.DbSketch --version 0.1.3
DbSketch
DbSketch is a small C# CLI tool that reads a live database schema and writes a compact Graphviz DOT diagram.
The MVP supports SQL Server, PostgreSQL, and MySQL. It reads schemas/namespaces, tables, columns, primary key markers, and real foreign key relationships, then applies include/exclude table filters before rendering DOT.
Install
Global tool
dotnet tool install --global DimonSmart.DbSketch
dbsketch generate --config dbsketch.yml
Local tool in repository
dotnet new tool-manifest
dotnet tool install DimonSmart.DbSketch --version 0.1.0
dotnet tool restore
dotnet tool run dbsketch -- generate --config dbsketch.yml
One-shot run
dotnet tool exec DimonSmart.DbSketch@0.1.0 -- generate --config dbsketch.yml
With .NET 10, dnx can also run the tool:
dnx DimonSmart.DbSketch@0.1.0 -- generate --config dbsketch.yml
CI example
- name: Restore local tools
run: dotnet tool restore
- name: Generate DB schema diagram
env:
DB_CONNECTION: ${{ secrets.DB_CONNECTION }}
run: dotnet tool run dbsketch -- generate --config dbsketch.yml
Development
Build and test:
dotnet restore DbSketch.sln
dotnet build DbSketch.sln
dotnet test DbSketch.sln
dotnet pack src/DbSketch.Cli/DbSketch.Cli.csproj -c Release
The .NET tool package id is DimonSmart.DbSketch; the installed command remains dbsketch.
Direct CLI options can override config values:
dbsketch generate --provider sqlserver --connection "Server=.;Database=AppDb;Trusted_Connection=True;TrustServerCertificate=True" --out docs/db/schema.dot
Config
provider: sqlserver
connectionString: ${DB_CONNECTION}
include:
tables:
- "dbo.*"
exclude:
tables:
- "dbo.__EFMigrationsHistory"
- "dbo.Log_*"
output:
path: docs/db/schema.dot
format: dot
diagram:
title: "Database schema"
rankdir: LR
compact: true
show:
schemaName: true
columnTypes: false
nullability: false
primaryKeys: true
foreignKeys: true
descriptions:
enabled: false
Provider aliases: mssql maps to sqlserver, and postgresql maps to postgres.
Markdown DOT
Use format: md-dot or --format md-dot to write Markdown with a fenced dot block instead of a raw .dot file.
Manual Integration Tests
DbSketch has explicit manual integration tests that use Testcontainers and require Docker. They are not run by default.
Run them explicitly:
dotnet test --filter-method "DimonSmart.DbSketch.Tests.Integration.PostgresNorthwindEndToEndTests.Generate_WithPostgresNorthwind_WritesDotSchema" --explicit only
Example DOT
digraph DbSketch {
graph [
rankdir=LR,
labelloc="t",
label="Database schema"
];
"table_dbo_Orders":"col_UserId" -> "table_dbo_Users":"col_Id" [
label="FK_Orders_Users"
];
}
Not Supported Yet
DbSketch does not render SVG/PNG, run Graphviz, generate Mermaid/DBML, infer relationships by naming convention, read database comments, generate HTML docs, diff schemas, or provide a GUI.
| 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. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.21 | 86 | 8/13/2026 |
| 0.1.20 | 85 | 8/13/2026 |
| 0.1.19 | 75 | 8/12/2026 |
| 0.1.18 | 82 | 8/12/2026 |
| 0.1.17 | 112 | 7/6/2026 |
| 0.1.16 | 108 | 7/6/2026 |
| 0.1.15 | 118 | 7/6/2026 |
| 0.1.14 | 112 | 7/3/2026 |
| 0.1.13 | 113 | 7/3/2026 |
| 0.1.12 | 108 | 7/3/2026 |
| 0.1.11 | 120 | 7/3/2026 |
| 0.1.10 | 118 | 7/3/2026 |
| 0.1.9 | 117 | 7/3/2026 |
| 0.1.8 | 112 | 7/2/2026 |
| 0.1.7 | 99 | 7/2/2026 |
| 0.1.6 | 133 | 7/1/2026 |
| 0.1.5 | 119 | 7/1/2026 |
| 0.1.4 | 116 | 7/1/2026 |
| 0.1.3 | 132 | 6/30/2026 |