Schemata.Modeling.Generator
10.0.0-preview.26264.43
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
<PackageReference Include="Schemata.Modeling.Generator" Version="10.0.0-preview.26264.43" />
<PackageVersion Include="Schemata.Modeling.Generator" Version="10.0.0-preview.26264.43" />
<PackageReference Include="Schemata.Modeling.Generator" />
paket add Schemata.Modeling.Generator --version 10.0.0-preview.26264.43
#r "nuget: Schemata.Modeling.Generator, 10.0.0-preview.26264.43"
#:package Schemata.Modeling.Generator@10.0.0-preview.26264.43
#addin nuget:?package=Schemata.Modeling.Generator&version=10.0.0-preview.26264.43&prerelease
#tool nuget:?package=Schemata.Modeling.Generator&version=10.0.0-preview.26264.43&prerelease
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.
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#
recordwith all declared fields as properties. - Trait interfaces — a C#
interfaceperTraitblock. - Enums — a C#
enumperEnumblock.
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
- Schemata.Business.Complex.Targets — includes DSL for business libraries
- Schemata.Module.Complex.Targets — includes DSL for module libraries
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 |