![]() |
VOOZH | about |
dotnet add package EzDbSchema --version 8.3.3
NuGet\Install-Package EzDbSchema -Version 8.3.3
<PackageReference Include="EzDbSchema" Version="8.3.3" />
<PackageVersion Include="EzDbSchema" Version="8.3.3" />Directory.Packages.props
<PackageReference Include="EzDbSchema" />Project file
paket add EzDbSchema --version 8.3.3
#r "nuget: EzDbSchema, 8.3.3"
#:package EzDbSchema@8.3.3
#addin nuget:?package=EzDbSchema&version=8.3.3Install as a Cake Addin
#tool nuget:?package=EzDbSchema&version=8.3.3Install as a Cake Tool
A powerful .NET library that provides comprehensive database schema analysis and code generation capabilities. It allows you to extract complete database schemas including columns, relationships, and advanced features detection, making it perfect for code generation and database documentation tasks.
This project is licensed under the MIT License - see the file for details.
To facilitate AI-powered development and code generation, we provide a comprehensive guide. This documentation is specifically designed to help AI models understand and work with the EzDbSchema library effectively.
AI models can leverage this documentation to:
Rapid Application Development
Database Documentation
Database Migration
Code Generation
Architecture Analysis
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
You will need MSSQL with some database installed. If you need a sample database, feel free to look for the World Wide Importers samples.
Install-Package EzDbSchema.Core
// Connect to database and get schema
var schema = new EzDbSchema.MsSql.Database().Render(
"MySchema",
"Server=myserver;Database=mydb;User Id=sa;Password=****;TrustServerCertificate=True"
);
// Generate code for entities
var codeGen = new DatabaseCodeGenInfo(schema);
// Get required features
var features = codeGen.RequiredFrameworkFeatures;
// Returns: ["Auditing", "Versioning", etc.]
// Get dependency graph
var dependencies = codeGen.DependencyGraph;
// Returns: { "Order": ["Customer", "Product"], ... }
// Get complete schema with all properties
var schema = new EzDbSchema.MsSql.Database().Render("MySchema", connectionString);
// Dump schema to JSON (useful for Handlebars template development)
var schemaJson = Newtonsoft.Json.JsonConvert.SerializeObject(schema, Newtonsoft.Json.Formatting.Indented);
File.WriteAllText("schema.json", schemaJson);
// Available Schema Properties:
/*
{
"Name": "MySchema",
"Entities": {
"TableName": {
"TableName": "string",
"Properties": {
"ColumnName": {
"ColumnName": "string",
"PropertyName": "string",
"IsNullable": "bool",
"IsIdentity": "bool",
"IsPrimaryKey": "bool",
"DataType": "string",
"MaxLength": "int",
"Precision": "int",
"Scale": "int",
"HasValidationRules": "bool"
}
},
"Relationships": [
{
"FromTableName": "string",
"ToTableName": "string",
"FromColumnName": "string",
"ToColumnName": "string",
"RelationshipName": "string",
"Multiplicity": "string"
}
],
"HasCompositePrimaryKey": "bool",
"IsAuditable": "bool",
"IsVersioned": "bool",
"IsSoftDeletable": "bool"
}
}
}
*/
// Check for specific patterns
var hasAuditableEntities = codeGen.HasAuditableEntities;
var hasVersionedEntities = codeGen.HasVersionedEntities;
var hasSoftDelete = codeGen.HasSoftDeletableEntities;
// Generate API controllers
var apiCode = codeGen.GenerateApiControllers();
// Generate ORM entities
var ormCode = codeGen.GenerateOrmEntities();
EzDbSchema.Cli/appsettings.json:{
"ConnectionString": "Server=myserver;Database=mydb;User Id=sa;Password=****;TrustServerCertificate=True"
}
dotnet EzDbSchema.Cli.dll --schema MySchema
This will generate MySchema.db.json with the complete schema analysis.
This project was design to be hosted and distributed with nuget.com.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the file for details
Many thanks to the following projects that have helped in this project
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on EzDbSchema:
| Package | Downloads |
|---|---|
|
EzDbCodeGen.Core
This will install a local cli tool. From this path, you can run a powershell script that will generate code based on the connection string. Each template is a handlebars template that has tags that specify where you would like to output the generated code and if there is a vs project that you wish to update with the file list (old VS project formats only). |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.3.3 | 360 | 3/18/2025 |
| 8.3.2 | 334 | 3/17/2025 |
| 8.2.0 | 362 | 8/26/2024 |
| 8.0.2 | 742 | 3/17/2024 |
| 8.0.1 | 296 | 3/17/2024 |
| 8.0.0 | 288 | 3/17/2024 |
| 7.0.0 | 586 | 1/2/2023 |
| 6.0.1 | 1,030 | 4/27/2022 |
| 6.0.0 | 6,925 | 11/23/2021 |
| 5.0.9 | 600 | 9/7/2021 |
| 5.0.8 | 555 | 9/6/2021 |
| 5.0.7 | 670 | 6/20/2021 |
| 1.0.53 | 1,449 | 5/13/2020 |
| 1.0.31 | 2,224 | 12/21/2019 |
| 1.0.29 | 822 | 8/30/2019 |
| 1.0.28 | 1,872 | 6/6/2019 |
| 1.0.27 | 815 | 6/5/2019 |
| 1.0.26 | 1,206 | 2/22/2019 |
Version 8.3.3 (2025-03-17):
- Enhanced string extension methods for better .NET 8.0 compatibility
- Improved handling of null inputs in string operations
- Updated Microsoft.Extensions.* packages to 9.0.3
- Updated Microsoft.Data.SqlClient to 6.0.1
- Updated System.Text.Json to 9.0.3
- Standardized on modern JSON libraries (System.Text.Json and Newtonsoft.Json)
- Removed legacy .NET Framework dependencies
- Security improvements through package updates