Projects an ISchema into normalized storage rows for the Pure relational schema meta-model.
Pure.RelationalSchema.Self.Storage.Projection takes an ISchema and projects it into a set of storage rows grouped by table. The result is an IEnumerable<IGrouping<ITable, IRow>> that covers every structural element of the schema — column types, columns, tables, indexes, foreign keys, and the join tables between them — ready to be persisted through the Pure.RelationalSchema.Storage layer.
| Type | Kind | Description |
|---|---|---|
SchemaProjection |
sealed record |
Entry point. Wraps an ISchema and enumerates all projection groups. |
SchemaEntityProjection |
sealed record |
Projects a single ISchema as an IRow into SchemasTable. |
SchemaProjection yields one IGrouping<ITable, IRow> per logical table in the self-schema:
| Table | Contents |
|---|---|
ColumnTypesTable |
Distinct column types across all tables |
ColumnsTable |
All columns, deduplicated by content hash |
TablesTable |
All tables |
TablesToColumnsTable |
Table ↔ column membership |
IndexesTable |
All indexes |
IndexesToColumnsTable |
Index ↔ column membership |
TablesToIndexesTable |
Table ↔ index membership |
ForeignKeysTable |
All foreign keys with referencing/referenced table UUIDs |
ForeignKeysToReferencingColumnsTable |
Foreign key ↔ referencing column |
ForeignKeysToReferencedColumnsTable |
Foreign key ↔ referenced column |
SchemasTable |
The schema itself as a single row |
SchemasToTablesTable |
Schema ↔ table membership |
SchemasToForeignKeysTable |
Schema ↔ foreign key membership |
Each entity is identified by a ULID-based UUID cell and deduplicated by a content hash computed over the entity's structural fields.
- Self-describing — the target tables are defined by
Pure.RelationalSchema.Self.Schema, so the meta-model describes itself. - Content-addressed — every entity row is keyed by a hex-encoded structural hash; duplicates across tables are collapsed automatically.
- AOT-compatible — the library carries
IsAotCompatible = trueand avoids reflection.
Pure.RelationalSchema.Self.Schema— target table and column definitions for the self-describing schemaPure.RelationalSchema.Storage—IRow,ICell,ITableabstractions and theCellimplementationPure.RelationalSchema.HashCodes— content-addressed hashing for schema entities (TableHash,ColumnHash,IndexHash,ForeignKeyHash)Pure.RelationalSchema.Storage.HashCodes— hash codes for storage-layer column objectsPure.Primitives— immutableStringandUlidvalue types used as cell valuesPure.Primitives.String.Operations—HexStringconversion for hash-to-string encodingPure.Collections.Generic—Dictionary<TKey, TValue, TItem>with custom key/value selectors
- .NET 8
- .NET 9
- .NET 10
dotnet add package Pure.RelationalSchema.Self.Storage.Projection
ISchema schema = ...; // your ISchema implementation
SchemaProjection projection = new SchemaProjection(schema);
foreach (IGrouping<ITable, IRow> group in projection)
{
ITable table = group.Key;
foreach (IRow row in group)
{
foreach ((IColumn column, ICell cell) in row.Cells)
{
// persist or process each cell
}
}
}