SqlAntlrCodeGenerator
Generic entry point that orchestrates the three codegen phases (model, data access method, source file) using a `` supplied by the platform library. The SQLite and Postgres code generators both reduce to ~30-line shells around this class.
public static class SqlAntlrCodeGenerator
Methods
GenerateCodeWithMetadata(string, string, SelectStatement, IReadOnlyList<DatabaseColumn>, CodeGenerationConfig, GroupingConfig?)
public static Result<string, SqlError> GenerateCodeWithMetadata(string fileName, string sql, SelectStatement statement, IReadOnlyList<DatabaseColumn> columnMetadata, CodeGenerationConfig config, GroupingConfig? groupingConfig = null)
Generates C# source for a SQL file using already-resolved column metadata.
Parameters:
| Name | Type | Description |
|---|---|---|
fileName |
String |
The SQL file base name (used for type + method names). |
sql |
String |
The SQL content. |
statement |
SelectStatement |
The parsed statement metadata (parameters, etc.). |
columnMetadata |
DatabaseColumn> |
Column metadata returned by the driver. |
config |
CodeGenerationConfig |
The dialect-specific code generation config. |
groupingConfig |
GroupingConfig |
Optional grouping for parent-child shaping. |
Returns: SqlError> - Generated source on success, an `` on failure.