Repository navigation
v1.2.0
1.2.0
Highlights
-
SQL → SqExpress pipeline
- Parse raw T-SQL into SqExpress AST
- Validate SQL at compile time via Roslyn analyzer
- Convert SQL into strongly-typed SqExpress C# code
-
Parameterization for real db queries
- Configurable strategies (
None,ThrowOnLimit,LiteralFallback) - Built-in handling of database parameter limits
- Configurable strategies (
-
Advanced schema-aware tooling
- Source-generated models from table descriptors (
[TableDescriptor],[SqModel]) - Derived-table descriptors with strict analyzer validation
- Stronger compile-time guarantees for schema correctness
- Source-generated models from table descriptors (
-
Query analysis & navigation
TablesGraphfor foreign-key traversal and join-path discovery- Automatic shortest-path join resolution
New Features
- Added non-generic syntax tree visitor support with
IExprVisitorandExprVisitorBase. ExprVisitorBasenow provides traversal context viaCurrentPath,CurrentNode, andDepth.- Added selecting-source abstractions for extracting projected columns and materializing a source as a subquery:
ISelectingSourceIExprTableSource.AliasExtractSelecting()ToSubQuery()
- Added parametrization modes to
SqDatabase:NoneThrowOnLimitLiteralFallback
- Added exporter parameter limits used by parametrization:
TSqlExporter:2000PgSqlExporter:65535MySqlExporter:65535
- Added
ExprPortableScalarFunction/PortableScalarFunctionand portable helpers inSqQueryBuilder(T-SQL-first names):Len,DataLengthYear,Month,Day,Hour,Minute,SecondCurrentDate,CurrentTime,CurrentTimestampIndexOf,Left,Right,Repeat
- Added dialect mappings for portable scalar functions in
TSqlBuilder,PgSqlBuilder, andMySqlBuilder. - Added an optional SQL-import workflow via
SqTSqlParser.Parse(...), including:- support for T-SQL named parameters (
@name) mapped toExprParameterwithWithParams(...)replacement helpers - mapping for common T-SQL functions (
LEN,DATALENGTH,CHARINDEX,LEFT,RIGHT,REPLICATE, date-part/current date-time functions) to portable AST nodes for PostgreSQL/MySQL export
- support for T-SQL named parameters (
- Added a built-in Roslyn analyzer and code fix for
SqTSqlParser.Parse(...):- validates raw SQL during compilation
- checks discovered SqExpress table descriptors
- can convert supported
SqTSqlParser.Parse(...)calls into generated SqExpress C# code
- Added attribute-based
SqModelsource generation for table declarations:- class-level
SqModelon[TableDescriptor]/[TempTableDescriptor] - column-level
SqModelsandSqModelCast - source-generated DTO models now default to
recordshape when generated from analyzer-driven table declarations
- class-level
- Added dedicated derived-table descriptor support:
[DerivedTableDescriptor]Derived...Columnattributes for derived-table output columns- analyzer validation preventing descriptor-family mixing and enforcing that
Derived...Columnis only used with derived-table descriptors
- Added flags-based table comparison and inclusion helpers:
TableComparisonFlagsforCompareWith(...)TableIncludesFlagsforIncludes(...)
- Added
TablesGraphfor foreign-key-graph navigation and join-path discovery:Contains,References,GetReferences,GetAllReferences,GetReferencedBy,GetAllReferencedByTryToJoinTables(...)returning a joinableIExprTableSource- deterministic shortest-path selection when several join routes exist
- Added column-shape extraction helpers used by the
MERGEpolyfill to infer projected column names and SQL types from subqueries and table sources. - Added
TypedColumnas a shared typed-column abstraction for table and custom columns.
Bugfix
- MySQL metadata now treats
utf8mb3andutf8mb4columns as Unicode and exports Unicode columns asutf8mb4while preserving explicit column length when possible. (#4) MERGEpolyfill now supports more source shapes, including derivedSELECTsources, and preserves richer inferred temp-table column types where possible.- Typed custom-column conversion now preserves more SQL type details such as string length/fixed-size/XML, decimal precision-scale, byte-array size, and date/date-time distinctions.
Breaking Changes
- Some public syntax/source interfaces gained new members, including selecting-source and alias-related APIs, so custom implementations may need to be updated.
IQuerySpecificationBuilderFiltered.GroupBy(...)now acceptsExprValue/IReadOnlyList<ExprValue>instead ofExprColumn/IReadOnlyList<ExprColumn>.ExprOffsetFetch.OffsetandExprOffsetFetch.Fetchare nowExprValueinstead ofExprInt32Literal. In most existing code, the workaround is to cast explicitly toExprInt32Literal.ExprLike.TestandExprLike.Patternare nowExprValueinstead ofExprStringLiteral. In most existing code, the workaround is to cast explicitly toExprStringLiteral.SqModelGenTypenow defaults toRecordinSqExpress.props.ImmutableClassis still supported for backward compatibility.- The legacy file-based model builder (
genmodels/ property-level[SqModel]) is now deprecated and is planned for removal in2.0.