https://github.com/cklutz/docdb
Generate DocFX metadata from SQL Server database schema
https://github.com/cklutz/docdb
docfx docfx-plugin documentation-generator sql-server template
Last synced: about 2 months ago
JSON representation
Generate DocFX metadata from SQL Server database schema
- Host: GitHub
- URL: https://github.com/cklutz/docdb
- Owner: cklutz
- License: mit
- Created: 2024-05-20T09:13:30.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-09T10:45:06.000Z (12 months ago)
- Last Synced: 2025-10-25T07:53:57.439Z (7 months ago)
- Topics: docfx, docfx-plugin, documentation-generator, sql-server, template
- Language: C#
- Homepage:
- Size: 8.18 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DocDB
Generate metadata for SQL Server databases, for use with [DocFX](https://github.com/dotnet/docfx), to generate reference documentation.
[](https://www.nuget.org/packages/docdb.console)
[](https://github.com/cklutz/docdb/actions?query=workflow%3AWindows)
[](https://github.com/cklutz/docdb/blob/master/LICENSE)
You can use this tool to generate meta data files (.yml files) for a given SQL Server database.
Then use docfx to generate reference documentation like you would do for other languages (e.g. C#).
__Warning__: Albeit usable, this tool is not complete. Still lacking are unit tests and code coverage and integration style tests. YMMV.
## Features
DocDB can document the following SQL Server objects:
* Tables (including indexes, checks, keys, triggers)
* Stored Procedures
* Functions (scalar, table valued, aggregates)
* Types (data types, table types, CLR types)
* Assemblies (incl. decompiled C# code)
* DDL Triggers
* XML Schema collections
* Parition information (functions, schemes)
* Sequences
* Rules
* Defaults
* Roles (database and application roles)
* Users
* Synonyms
* Schemas
* Database itself (files, filegroups, settings, etc.)
All documents and objects are cross references (for example, foreign keys to target table).
For every applicable object, the relevant SQL CREATE script is included.
Additionally, a table of contents is generated that structures the objects as they are in
the Object Explorer of SSMS.
## Getting Started
1. Install docfx as a global tool:
```bash
dotnet tool install -g docfx
```
2. Install DocDB as a global tool:
```bash
dotnet tool install -g docdb.console
```
**TODO**: Document rest of procedure (or see [AdventureWorks2022 sample](samples/AdventureWorks2022/README.md)).
## Examples
The following pictures are based on the [AdventureWorks Sample Database](https://github.com/microsoft/sql-server-samples/tree/master/samples/databases/adventure-works/oltp-install-script). To generate those yourself see [AdventureWorks2022 sample](samples/AdventureWorks2022/README.md).

*Database Overview*

*Table Details*

*Views Overview*

*Stored Procedure Details*