Schemata.Modeling.Generator 10.0.0-preview.26264.43

This is a prerelease version of Schemata.Modeling.Generator.
dotnet add package Schemata.Modeling.Generator --version 10.0.0-preview.26264.43
                    
NuGet\Install-Package Schemata.Modeling.Generator -Version 10.0.0-preview.26264.43
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Schemata.Modeling.Generator" Version="10.0.0-preview.26264.43" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Schemata.Modeling.Generator" Version="10.0.0-preview.26264.43" />
                    
Directory.Packages.props
<PackageReference Include="Schemata.Modeling.Generator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Schemata.Modeling.Generator --version 10.0.0-preview.26264.43
                    
#r "nuget: Schemata.Modeling.Generator, 10.0.0-preview.26264.43"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Schemata.Modeling.Generator@10.0.0-preview.26264.43
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Schemata.Modeling.Generator&version=10.0.0-preview.26264.43&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Schemata.Modeling.Generator&version=10.0.0-preview.26264.43&prerelease
                    
Install as a Cake Tool

Schemata DSL (Schemata Modeling Language, aka SKM)

A Roslyn source generator that compiles .skm schema files into C# entity records, trait interfaces, and enums at build time.

GitHub Workflow Status Codecov license

Quick Start

dotnet add package --prerelease Schemata.Modeling.Generator

Add .skm files to your project with Build Action: AdditionalFiles (or use one of the business/module target packages that configure this automatically). The generator runs at compile time and produces C# files in obj/.

What Gets Generated

For each .skm file the generator produces C# source files placed in obj/ and automatically compiled into your assembly:

  • Entity record — a C# record with all declared fields as properties.
  • Trait interfaces — a C# interface per Trait block.
  • Enums — a C# enum per Enum block.

Grammar Overview

Namespace

Every .skm file begins with a namespace declaration:

Namespace My.Project

Traits

Traits are reusable field groups. Entities compose them with Use:

Trait Identifier {
  long id [primary key]
}

Trait Timestamp {
  timestamp? create_time
  timestamp? update_time
}

Trait SoftDelete {
  timestamp? delete_time
  timestamp? purge_time
}

Trait Entity {
  Use Identifier, Timestamp
}

Entities

Entities map to database tables. They generate a C# entity class and one C# record per Object block:

Entity Book {
  Use Entity, SoftDelete

  string title [not null] { Length: 500 }
  string? author
  string? isbn [unique]
  int page_count

  Object detail {
    id
    title
    author
    page_count
    create_time
    update_time
  }

  Object summary {
    id
    title
    author
  }
}

Enums

Enum BookStatus {
  BookStatusUnspecified = 0
  Draft                 = 1
  Published             = 2
  Archived              = 3
}

Field Types

SKM Type C# Type
string string
text string
int / integer / int32 / int4 int
long / int64 / int8 long
biginteger / bigint System.Numerics.BigInteger
float / float32 / float4 float
double / float64 / float8 double
decimal / numeric / number decimal
boolean / bool bool
datetime / timestamp DateTimeOffset
guid / uuid Guid

Append ? for nullable: string? author, timestamp? delete_time.

Field Options

Declared in square brackets after the field name. Multiple options are comma-separated.

Option Effect
primary key Primary key constraint
auto increment Auto-incrementing primary key
not null / required Non-nullable constraint
unique Unique index
b tree B-tree index
hash Hash index
long   id    [primary key]
string email [unique, not null]
string? bio  [b tree]

Field Properties

Declared in curly braces after options. Provide column-level metadata:

Property Effect
Length N Maximum string length
Precision N Decimal precision
Default value Default column value
Algorithm name Hash algorithm (for hashed fields)
string  title [not null] { Length 500 }
decimal price            { Precision 2 }

See Also

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.0-preview.26264.43 34 5/14/2026
10.0.0-preview.26263.11 35 5/13/2026
10.0.0-preview.26262.64 42 5/12/2026
10.0.0-preview.26259.24 57 5/9/2026
10.0.0-preview.26259.20 48 5/9/2026
10.0.0-preview.26253.58 45 5/3/2026
10.0.0-preview.26253.39 39 5/3/2026
10.0.0-preview.26253.37 40 5/3/2026
10.0.0-preview.26251.71 50 5/1/2026
10.0.0-preview.26177.58 65 3/27/2026
10.0.0-preview.26177.40 57 3/27/2026
10.0.0-preview.26177.31 58 3/27/2026
10.0.0-preview.26175.94 53 3/25/2026
10.0.0-preview.26175.59 54 3/25/2026
10.0.0-preview.26174.30 51 3/24/2026
10.0.0-preview.26174.28 55 3/24/2026