Skip to content

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.

Core Concepts — Immutable AST, Dialect Compilers & AOT Execution

EricksonLopez.SqlBuilder separates immutable query construction (Sql.From<T>(), Sql.Insert, Sql.Update<T>(), Sql.Delete<T>(), Sql.Raw(FormattableString)) from dialect compilation and ADO.NET/Dapper execution.

  • Query builders produce immutable AST nodes (FromNode, WhereNode, LimitNode, etc.). Branching a shared base query (var baseQ = Sql.From<OrderRecord>().Where(o => o.CustomerId == 42L);) never mutates baseQ.
  • Sql.Raw(FormattableString) captures interpolated arguments as SQL parameters automatically (ESQL011 flags raw string overloads).
  • DeleteQuery<T> guards against missing .Where(...) clauses at runtime unless explicitly structured.
  • ISqlCompiler.Compile(ISqlQuery) and AotQueryAsync(ISqlQuery, ISqlCompiler, ...): Carry [RequiresDynamicCode] and [RequiresUnreferencedCode] because compiling LINQ lambda predicates inspects expression trees.
  • Zero-warning Native AOT execution: Pre-compile static RawQuery or query definitions into SqlResult and pass that SqlResult to connection.AotQueryAsync(precompiled, OrderRecord.GetReaderParser(), cancellationToken: ct) (EricksonLopez.SqlBuilder.Aot) or AotDapperExtensions.AotQueryAsync(connection, precompiled, mapper) (EricksonLopez.SqlBuilder.Dapper.Aot).
  • Source Generator (SqlBuilder.SourceGenerators): Generates IStaticEntityMetadata<T> and GetReaderParser() on [SqlEntity("table")] public partial class ... types with zero runtime reflection.