Skip to content

Catalin-Andronie/dbml.net

Repository files navigation

dbml.net

Build Status

Inspired by Holistics DBML and tailored for .NET developers.

Abbreviations:

  • DBML: Database Markup Language

Repository Contents:

  1. DbmlNet Library: A .NET parser library for parsing *.dbml files.
  2. dbnet CLI Tool: A .NET CLI tool to generate SQL files from *.dbml inputs.

dbnet run --print

Table of Contents:

DbmlNet Parser Features

DbmlNet Features:

Prerequisites

  1. Install the latest .NET Core 7 SDK.

  2. Verify that dotnet is installed by running the following command:

    dotnet --version
  3. Restore development tools by running:

    dotnet tool restore

Running the Solution

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.

dbnet --help

For more examples, check the documentation.

Sample Databases

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

Contoso Data Warehouse

A sample data warehouse demonstrating data loading into Azure SQL Data Warehouse.

AdventureWorks

Sample databases and Analysis Services models for use with SQL Server.

Wide World Importers

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).

Building the Solution

  1. Check the build runs on CI --or--

  2. On the root folder, run:

    dotnet build

Unit Tests

  1. Check test runs on CI --or--

  2. On the root folder, run:

    dotnet cake --task=unit-tests

Integration Tests

  1. Check test runs on CI --or--

  2. On the root folder, run:

    dotnet cake --task=integration-tests

Code Coverage

  1. Check code coverage reports on CI --or--

  2. 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

Any problem?

Feel free to report issues. 😃