DataDictionaryGenerator
Create data dictionary from EF Core context
Install / Use
/learn @bairdj/DataDictionaryGeneratorREADME
Data Dictionary Generator
This library creates a rich data dictionary from a provided Entity Framework Core DbContext.
The intended use case is to provide users with a thorough description of a database without needing to read code. The generated data dictionary includes information from System.ComponentModel.DataAnnotations annotations that provides greater detail than just inspecting the SQL schema.
Generated fields include:
- Entity name
- Table name (for table per hierarchy)
- Field display name
- Field description
- Mapped SQL column type
- CLR type
- Constraints (validation attributes)
- Collected from/until dates (using additional attributes)
- Nullability
- Foreign keys (non-composite)
- Options (when using enum fields)
- Uniqueness
- Default SQL values
The library contains built-in outputs to:
- CSV
- Word (docx)
The underlying DataDictionary object can be used to output the data dictionary in customised ways, such as an ASP.NET page or as part of an API.
Usage
The library can be installed from NuGet.
A minimal program looks like:
using DataDictionaryGenerator;
using DataDictionaryGenerator.Outputs;
var dbContext = new YourDbContext();
// Ensure that the DbContext is configured with a provider, by explicitly passing options or by overriding OnConfiguring within your DbContext class
// You could also resolve this from DI if applicable
var dictionary = DataDictionary.FromDbContext(dbContext);
// Output as CSV
await using var csvFile = File.Open("Data dictionary.csv", FileMode.Create);
await CsvOutput.GenerateAsync(dictionary, new StreamWriter(csvFile));
// Output Word
var wordDocument = WordOutput.Generate(dictionary);
wordDocument.Write(File.Open("Data dictionary.docx", FileMode.Create));
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
