Inspired by Holistics DBML and tailored for .NET developers.
Abbreviations:
- DBML: Database Markup Language
Repository Contents:
- DbmlNet Library: A .NET parser library for parsing *.dbml files.
- dbnet CLI Tool: A .NET CLI tool to generate SQL files from *.dbml inputs.
Table of Contents:
- DbmlNet Parser Features
- Prerequisites
- Running the Solution
- Sample Databases
- Building the Solution
- Unit Tests
- Integration Tests
- Code Coverage
- Any problem?
DbmlNet Features:
- Project Definition
- Schema Definition
- Public Schema
- Table Definition
- Column Definition
- Index Definition
- Index with single field
- Index with multiple fields
- Index with an expression
- Composite index with expression
- Index Settings
- Relationships & Foreign Key Definitions
- Composite foreign keys
- Cross-schema relationship
- Relationship Settings
- Many-to-Many Relationship
- Comments
- Note Definition
- Multi-line String
- Enum Definition
- TableGroup
- Syntax Consistency
-
Install the latest .NET Core 7 SDK.
-
Verify that dotnet is installed by running the following command:
dotnet --version
-
Restore development tools by running:
dotnet tool restore
To run dbnet
, use the available scripts in the root folder based on your platform:
Windows:
./dbnet.cmd --help
Apple and Linux:
./dbnet.sh --help
The --help
option provides usage instructions. You can provide a file or directory path as an input parameter.
For more examples, check the documentation.
The ./sample/
directory contains sample databases like Contoso Data Warehouse, AdventureWorks, and Wide World Importers. Learning materials use the pattern sample-*.dbml
for the file name.
Visualize the Syntax Tree:
Use the --print
flag to visualize the syntax tree of a *.dbml file.
Example:
./dbnet.[cmd|sh] ./samples/sample-project.dbml --print
A sample data warehouse demonstrating data loading into Azure SQL Data Warehouse.
Sample databases and Analysis Services models for use with SQL Server.
A new sample database for SQL Server 2016 and Azure SQL Database, illustrating core capabilities for transaction processing, data warehousing, analytics, and hybrid transaction and analytics processing (HTAP).
-
Check the build runs on CI --or--
-
On the root folder, run:
dotnet build
-
Check test runs on CI --or--
-
On the root folder, run:
dotnet cake --task=unit-tests
-
Check test runs on CI --or--
-
On the root folder, run:
dotnet cake --task=integration-tests
-
On the root folder, run:
dotnet cake --task=code-coverage-reports
- Automatically open code coverage reports with
--open-reports
:
dotnet cake --task=code-coverage-reports --open-reports
- Automatically open code coverage reports with
Feel free to report issues. 😃