Skip to content

Search EricksonLopez.* Ecosystem

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

EricksonLopez.SqlBuilder Overview

EricksonLopez.SqlBuilder (2.0.0 on NuGet, L3) builds immutable, parameterized SQL query ASTs (SelectQuery<T>, InsertQuery<T>, UpdateQuery<T>, DeleteQuery<T>, RawQuery) compiled cleanly across six database dialects without string-concatenation injection risks.

  • Immutable AST branching: Every .Where(...), .OrderByDescending(...), or .Limit(...) call returns a new query instance so base filters can be shared safely across repositories.
  • Strict identifier & parameter hygiene (v2.0.0): SqlNamingHelper.ValidateIdentifier rejects malformed identifiers, ParameterManager.AddNamed prevents parameter collisions, and negative Limit/Offset values fail eagerly.
  • Pre-compiled Native AOT execution path: Dialect compilers (PostgreSqlCompiler, SqlServerCompiler, etc.) evaluate expression trees under [RequiresDynamicCode] / [RequiresUnreferencedCode], while AotConnectionExtensions.AotQueryAsync(connection, SqlResult, mapper) executes pre-compiled SqlResult or RawQuery commands with [SqlEntity] source-generated GetReaderParser() for zero-warning Native AOT execution.
  • Package scope clarity: All 16 packages are published (2.0.0, 6,827 downloads). There is no EF Core integration package in sql-builder; the 3 runtime Incompatible packages are Dapper, Oracle, and Testing.
flowchart LR
App["Sql.From<T>() / Sql.Raw($...)"] --> AST["Immutable Query AST"]
AST --> Comp["ISqlCompiler (PostgreSqlCompiler / SqlServerCompiler / ...)"]
Comp --> Res["SqlResult (Sql + ParameterManager)"]
Res --> Exec["AotConnectionExtensions (SqlResult + GetReaderParser) / Dapper"]
Immutable AST Compilation and AOT Execution FlowSql.From builds an immutable SelectQuery AST, ISqlCompiler compiles it into a parameterized SqlResult, and AotConnectionExtensions or Dapper executes it against the target database.
View accessible text summary and structure

Sql.From builds an immutable SelectQuery AST, ISqlCompiler compiles it into a parameterized SqlResult, and AotConnectionExtensions or Dapper executes it against the target database.

flowchart LR
App["Sql.From<T>() / Sql.Raw($...)"] --> AST["Immutable Query AST"]
AST --> Comp["ISqlCompiler (PostgreSqlCompiler / SqlServerCompiler / ...)"]
Comp --> Res["SqlResult (Sql + ParameterManager)"]
Res --> Exec["AotConnectionExtensions (SqlResult + GetReaderParser) / Dapper"]

All 16 packages are published at 2.0.0 on NuGet (net8.0;net9.0;net10.0, netstandard2.0 for Roslyn tools; localVersion: 3.0.0 on disk). Overall AOT status is Partial (11 Full, 3 Incompatible, 2 NotApplicable):

Package NuGet (2.0.0) AOT Status Role
EricksonLopez.SqlBuilder Published (1,126 dl) Full Core AST builders (Sql.From<T>, Insert, Update, Delete, Raw)
EricksonLopez.SqlBuilder.Abstractions Published (1,312 dl) Full ISqlQuery, ISqlCompiler, SqlResult, [SqlEntity], [Indexed]
EricksonLopez.SqlBuilder.Aot Published (173 dl) Full AotConnectionExtensions.AotQueryAsync over ADO.NET
EricksonLopez.SqlBuilder.Dapper.Aot Published (162 dl) Full AotDapperExtensions.AotQueryAsync(connection, SqlResult, mapper)
EricksonLopez.SqlBuilder.PostgreSql / Sqlite / MySql / SqlServer / MariaDb Published (385 / 862 / 332 / 294 / 276 dl) Full Dialect compilers and provider-specific SQL extensions
EricksonLopez.SqlBuilder.Pagination Published (219 dl) Full Paginate<T>, ApplyCursor<T, TKey>, ToPagedList<T>
EricksonLopez.SqlBuilder.OpenTelemetry Published (280 dl) Full SqlBuilderInstrumentation.StartQueryActivity
EricksonLopez.SqlBuilder.Dapper Published (259 dl) Incompatible IsAotCompatible=false, EnableTrimAnalyzer=false (Dapper runtime emit)
EricksonLopez.SqlBuilder.Oracle Published (309 dl) Incompatible IsAotCompatible=false (Oracle.ManagedDataAccess.Core)
EricksonLopez.SqlBuilder.Testing Published (281 dl) Incompatible IsAotCompatible=false, EnableTrimAnalyzer=false
EricksonLopez.SqlBuilder.Analyzers Published (277 dl) NotApplicable netstandard2.0 Roslyn analyzers (ESQL001–ESQL026, ELSB004/006, SQL0003–0009)
EricksonLopez.SqlBuilder.SourceGenerators Published (280 dl) NotApplicable netstandard2.0 [SqlEntity] static metadata & GetReaderParser() generator

Measured directly from BenchmarkDotNet.Artifacts (3 measured rows, 0 na_error rows) in SelectBenchmarks on .NET 10.0.11 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI (no NativeAOT reports):

  • SqlBuilder_SimpleSelect: 544 ns / 1,966 B
  • SqlBuilder_ComplexSelect: 1,305.3 ns / 3,738 B
  • SqlBuilder_GroupBy: 1,567.2 ns / 2,478 B