Schemata.Modeling.Generator 10.0.0-preview.26456.11

This is a prerelease version of Schemata.Modeling.Generator.
dotnet add package Schemata.Modeling.Generator --version 10.0.0-preview.26456.11
                    
NuGet\Install-Package Schemata.Modeling.Generator -Version 10.0.0-preview.26456.11
                    
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.26456.11" />
                    
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.26456.11" />
                    
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.26456.11
                    
#r "nuget: Schemata.Modeling.Generator, 10.0.0-preview.26456.11"
                    
#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.26456.11
                    
#: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.26456.11&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Schemata.Modeling.Generator&version=10.0.0-preview.26456.11&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

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in 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.26456.11 38 9/6/2026
10.0.0-preview.26454.47 37 9/4/2026
10.0.0-preview.26452.4 31 9/2/2026
10.0.0-preview.26452.1 33 9/2/2026
10.0.0-preview.26451.67 35 9/1/2026
10.0.0-preview.26420.39 65 8/20/2026
10.0.0-preview.26377.57 70 7/27/2026
10.0.0-preview.26374.56 62 7/24/2026
10.0.0-preview.26371.96 70 7/22/2026
10.0.0-preview.26371.18 57 7/21/2026
10.0.0-preview.26361.52 64 7/11/2026
10.0.0-preview.26360.38 65 7/10/2026
10.0.0-preview.26359.42 64 7/9/2026
10.0.0-preview.26358.53 58 7/8/2026
10.0.0-preview.26330.14 73 6/30/2026
10.0.0-preview.26329.17 69 6/29/2026
10.0.0-preview.26328.27 67 6/28/2026
10.0.0-preview.26326.65 195 6/26/2026
10.0.0-preview.26325.41 76 6/25/2026
10.0.0-preview.26325.33 78 6/25/2026
Loading failed