EricksonLopez.SqlBuilder

dotnet-sql-builder · Consultas y Datos

En esta página (20 secciones)

1. Identidad, Nivel y Perfil de Madurez#

L3 Persistencia e IntegracionesEstableMantenimiento: ActivoAOT: ParcialLicencia MITConfianza: HIGH
Infrastructurenet8.0net9.0net10.0

2. Propuesta de Valor y Problema que Resuelve#

Immutable, Native AOT-first SQL query builder and high-performance execution ecosystem for .NET 8, 9 & 10. Features type-safe AST compilation, zero-reflection source generators, Roslyn analyzers, and dialect compilers for PostgreSQL, SQL Server, MySQL, MariaDB, SQLite, and Oracle.

Los ORMs pesados añaden rastreo costoso y traducciones LINQ impredecibles, mientras el SQL concatenado en cadenas carece de seguridad de tipos y expone a inyección SQL.

3. Instalación Rápida#

Paquete principal: EricksonLopez.SqlBuilder

dotnet add package EricksonLopez.SqlBuilder --version 2.0.0
También publicado en esta familia:
EricksonLopez.SqlBuilder.AbstractionsEricksonLopez.SqlBuilder.SqliteEricksonLopez.SqlBuilder.PostgreSqlEricksonLopez.SqlBuilder.MySqlEricksonLopez.SqlBuilder.OracleEricksonLopez.SqlBuilder.SqlServer

4. Métricas Verificadas del Ecosistema#

v2.0.0
Versión Publicada en NuGet
v3.0.0
Versión HEAD del Repo
6,827
Descargas en NuGet
16
Paquetes Empaquetables
1,452
Miembros Públicos de API
3
Filas Benchmark (RyuJIT)

Instantánea recuperada UTC: 2026-12-01

5. Cuándo Usar y Cuándo NO Usar#

Cuándo usar

  • Quieres constructores AST inmutables (SelectQuery<T>, InsertQuery<T>, UpdateQuery<T>, DeleteQuery<T>) compilados para 6 dialectos SQL.

Cuándo NO usar

  • Buscas predicados de dominio con expresiones (`Expression<Func<T, bool>>`); usa EricksonLopez.Specification.

6. Capacidades Principales e Invariantes de Diseño#

AST Inmutable y Generadores Roslyn

Composición de consultas basada en records con CTEs, window functions, LATERAL joins y metadatos [SqlEntity] en compilación.

6 Compiladores de Dialecto y Analizadores

Paquetes modulares para PostgreSQL, SQL Server, MySQL, MariaDB, SQLite y Oracle más analizadores de seguridad SQL.

7. Paquetes NuGet y Adaptadores Incluidos#

ID del PaqueteEstadoNuGet / LocalTFMsEstado AOTDescargasDescripción
EricksonLopez.SqlBuilderPrincipalPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo1,126Immutable NativeAOT-friendly SQL Builder core — AST, query builders, expression visitors, and dialect compilation contracts.
EricksonLopez.SqlBuilder.AbstractionsPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo1,312Contracts, interfaces, and AST node definitions for EricksonLopez.SqlBuilder.
EricksonLopez.SqlBuilder.SqlitePublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo862Package Description
EricksonLopez.SqlBuilder.PostgreSqlPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo385AOT-compatible AST compiler for the PostgreSQL dialect with LATERAL joins, materialized CTEs, and window function FILTER support.
EricksonLopez.SqlBuilder.MySqlPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo332Package Description
EricksonLopez.SqlBuilder.OraclePublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Incompatible309Package Description
EricksonLopez.SqlBuilder.SqlServerPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo294Package Description
EricksonLopez.SqlBuilder.TestingPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Incompatible281Package Description
EricksonLopez.SqlBuilder.OpenTelemetryPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo280Package Description
EricksonLopez.SqlBuilder.MariaDbPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo276Package Description
EricksonLopez.SqlBuilder.DapperPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Incompatible259Seamless integration with Dapper and OpenTelemetry for EricksonLopez.SqlBuilder.
EricksonLopez.SqlBuilder.PaginationPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo219Pagination integration for EricksonLopez.SqlBuilder. Provides offset and keyset cursor pagination extension methods for SelectQuery AST.
EricksonLopez.SqlBuilder.AotPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo173Reflection-free, NativeAOT-compatible query execution layer for EricksonLopez.SqlBuilder. Executes compiled SQL directly over IDbConnection using source-generated entity mappers, with no runtime code generation and no dependency on Dapper.
EricksonLopez.SqlBuilder.Dapper.AotPublicadov2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Completo162Dapper.AOT and NativeAOT reflection-free execution extensions for EricksonLopez.SqlBuilder. Provides strongly-typed, allocation-free SQL query execution over DbConnection without runtime code generation.
EricksonLopez.SqlBuilder.SourceGeneratorsAnalizador / GeneradorPublicadov2.0.0 / v3.0.0netstandard2.0AOT: N/A (Analizador/Legado)280Roslyn analyzers and AOT source generators for EricksonLopez.SqlBuilder.
EricksonLopez.SqlBuilder.AnalyzersAnalizador / GeneradorPublicadov2.0.0 / v3.0.0netstandard2.0AOT: N/A (Analizador/Legado)277Roslyn Analyzers for EricksonLopez.SqlBuilder.

8. Ejemplo Quick Start#

Basado en APIs públicas verificadas de EricksonLopez.SqlBuilder. Compila con `<ImplicitUsings>disable</ImplicitUsings>` e importaciones explícitas.

using System;
using EricksonLopez.SqlBuilder.Annotations;

[SqlEntity("users")]
public partial class UserRecord
{
    [DatabaseGenerated]
    public int Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public string Email { get; set; } = string.Empty;
    public bool IsActive { get; set; }
}

9. Arquitectura y Flujo de Dependencias#

flowchart LR
  lib_sql_builder["EricksonLopez.SqlBuilder (L3)"]
  lib_result["EricksonLopez.Result (L0)"]
  lib_sql_builder --> lib_result
  lib_pagination["EricksonLopez.Pagination (L2)"]
  lib_sql_builder -.-> lib_pagination
  lib_dapper_extensions["EricksonLopez.DapperExtensions (L3)"]
  lib_dapper_extensions -.-> lib_sql_builder
Topología de Dependencias de EricksonLopez.SqlBuilder2 dependencias hacia librerías aguas arriba y 1 librerías dependientes aguas abajo verificadas en dependencies.json.
Ver descripción textual y tabla accesible

2 dependencias hacia librerías aguas arriba y 1 librerías dependientes aguas abajo verificadas en dependencies.json.

DirecciónLibreríaNivelTipos de Relación
Aguas arribaEricksonLopez.ResultL0Tiempo de compilación, Paquete NuGet
Aguas arribaEricksonLopez.PaginationL2Adaptador, Paquete NuGet
Aguas abajoEricksonLopez.DapperExtensionsL3Adaptador, Paquete NuGet
flowchart LR
  lib_sql_builder["EricksonLopez.SqlBuilder (L3)"]
  lib_result["EricksonLopez.Result (L0)"]
  lib_sql_builder --> lib_result
  lib_pagination["EricksonLopez.Pagination (L2)"]
  lib_sql_builder -.-> lib_pagination
  lib_dapper_extensions["EricksonLopez.DapperExtensions (L3)"]
  lib_dapper_extensions -.-> lib_sql_builder

10. Target Frameworks y Matriz Native AOT / Trimming#

Inspección MSBuild `.csproj` sobre 16 paquetes: 11 Full, 0 Partial, 3 Incompatible, 2 NotApplicable (analizadores/generadores).

ID del PaqueteIsAotCompatibleEnableTrimAnalyzerEstado AOT VerificadoTarget Frameworks
EricksonLopez.SqlBuildertruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.AbstractionstruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.SqlitetruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.PostgreSqltruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.MySqltruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.OraclefalsetrueIncompatiblenet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.SqlServertruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.TestingfalsefalseIncompatiblenet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.OpenTelemetrytruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.MariaDbtruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.DapperfalsefalseIncompatiblenet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.PaginationtruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.AottruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.Dapper.AottruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.SqlBuilder.SourceGeneratorsnullnullNotApplicablenetstandard2.0
EricksonLopez.SqlBuilder.AnalyzersnullnullNotApplicablenetstandard2.0

11. Dependencias Aguas Arriba y Dependientes Aguas Abajo#

Dependencias Aguas Arriba (2)

Dependientes Aguas Abajo (1)

12. Adaptadores Opcionales e Integraciones Externas#

Aristas de Adaptadores Internos y Paquetes de Integración

Dependencias NuGet Externas Verificadas (22)

AwesomeAssertionsBogusDapperMicrosoft.CodeAnalysis.CSharpMicrosoft.CodeAnalysis.CSharp.WorkspacesMicrosoft.Data.SqlClientMicrosoft.Data.SqliteMicrosoft.Extensions.Logging.AbstractionsMicrosoft.Extensions.ObjectPoolMySqlConnectorNpgsqlOpenTelemetry.ApiOracle.ManagedDataAccess.CoreSQLitePCLRaw.lib.e_sqlite3SSH.NETSystem.Collections.ImmutableTestcontainers.MsSqlTestcontainers.MySqlTestcontainers.OracleTestcontainers.PostgreSqlVerify.Xunitxunit

13. Resumen de Configuración y Registro en DI#

Puntos de Entrada DI y Configuración Verificados

  • DeleteQuery<T>.AddNode

    Appends the specified node to the query AST.

  • InsertQuery<T>.AddNode

    Appends the specified node to the query AST.

  • SelectQuery<T>.AddNode

    Appends the specified node to the query AST.

  • UpdateQuery<T>.AddNode

    Appends the specified node to the query AST.

  • IParameterManager.AddNamed

    Adds a named parameter value and returns its formatted parameter name in the dialect's syntax.

  • InsertBuilder<T>.AddRule

    Adds a custom column selection rule to the insert operation.

  • UpdateBuilder<T>.AddRule

    Adds a custom column selection rule to the update operation.

  • OracleParameterManager.AddNamed

    Adds a named parameter value and returns its formatted parameter name in the dialect's syntax.

Tipos Públicos y Contratos Clave

  • EricksonLopez.SqlBuilder.AotSqlRendererBase (class)

    Provides a base implementation for an AOT-compatible SQL renderer that generates SQL statements using pooled `Text.StringBuilder` buffers (pool-rented, not allocation-free for SQL assembly) and zero-allocation data materialization for the `IDataReader → T` hot path.

  • EricksonLopez.SqlBuilder.CursorPaginationExtensions (class)

    Provides extension methods for implementing keyset (cursor-based) pagination.

  • EricksonLopez.SqlBuilder.DeleteQuery`1 (record)

    Represents a DELETE query syntax tree builder for the specified entity type.

  • EricksonLopez.SqlBuilder.DiffUpdateExtensions (class)

    Provides extension methods for generating UPDATE statements based on entity state differences.

  • EricksonLopez.SqlBuilder.DynamicSortingExtensions (class)

    Provides extension methods for applying dynamic sorting to queries using string-based column names.

  • EricksonLopez.SqlBuilder.InsertQuery`1 (record)

    Represents an INSERT query syntax tree builder for the specified entity type.

  • EricksonLopez.SqlBuilder.Param (class)

    Provides factory methods for creating explicitly typed SQL parameters.

  • EricksonLopez.SqlBuilder.QueryContract (record)

    Represents the verifiable shape of a compiled query.

  • EricksonLopez.SqlBuilder.QueryContractExtensions (class)

    Provides extension methods for generating query contracts.

  • EricksonLopez.SqlBuilder.RawQuery (record)

    Represents a raw SQL query that is always fully parameterized. Unlike Dapper's raw string approach, `RawQuery` never accepts string concatenation and enforces NativeAOT-safe parameter passing.

  • EricksonLopez.SqlBuilder.SelectQuery`1 (record)

    Represents a SELECT query syntax tree builder for the specified entity type.

  • EricksonLopez.SqlBuilder.Sql (class)

    Provides entry points and static factory methods for constructing type-safe SQL queries.

14. Benchmarks de Rendimiento Verificados#

Todas las mediciones verificadas provienen estrictamente de `BenchmarkDotNet.Artifacts` ejecutados sobre .NET RyuJIT (existen 0 ejecuciones NativeAOT en esta instantánea).

Filas totales: 3 · Medidos: 3 · NA / Error: 0 · Suites: 1

Runtimes observados: .NET 10.0.11 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI

CPUs observadas: Unknown processor

SuiteMétodoRuntimeMedia (ns)Asignado (B)Estado
SelectBenchmarksSqlBuilder_SimpleSelect.NET 10.0.11 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI5441,966measured
SelectBenchmarksSqlBuilder_ComplexSelect.NET 10.0.11 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI1,305.33,738measured
SelectBenchmarksSqlBuilder_GroupBy.NET 10.0.11 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI1,567.22,478measured

15. Historial de Versiones y Estado NuGet vs Repositorio#

Desfase de versiones detectado: la última versión publicada en NuGet.org es v2.0.0, mientras el HEAD del repositorio local está en v3.0.0.

VersiónOrigenFecha de PublicaciónResumen
v2.0.0 ↗nuget2026-09-24Published EricksonLopez.SqlBuilder 2.0.0 to NuGet.org.
v2.0.0 ↗github2026-09-24[2.0.0](https://github.com/ericksonlopezf/dotnet-sql-builder/compare/v1.0.0...v2.0.0) (2026-09-24) ⚠ BREAKING CHANGES * implement security invariants, AST validation, and dialect enhancements ✨ Features * implement security invariants, AST validation, and dialect enhancements ([d6bc61a](https://github.com/ericksonlopezf/dotnet-sql-builder/commit/d6bc61a2dc9d6ade2e0828f9ebfab813fd217325))
v1.0.0 ↗github2026-08-29Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.SqlBuilder.Abstractions` | `1.0.0` | | `EricksonLopez.SqlBuilder` | `1.0.0` | | `EricksonLopez.SqlBuilder.Aot` | `1.0.0` | | `EricksonLopez.SqlBuilder.Analyzers` | `1.0.0` | | `EricksonLopez.SqlBuilder.Dapper` | `1.0.0` | | `EricksonLopez.SqlBuilder.Dapper.Aot` | `1.0.0` | | `EricksonLopez.SqlBuilder...
v1.0.0 ↗nuget2026-08-29Published EricksonLopez.SqlBuilder 1.0.0 to NuGet.org.

Librerías en el mismo nivel, capa arquitectónica o vinculadas directamente mediante aristas de dependencia.

17. Documentación, API Reference y Enlaces del Portal#

Las páginas conceptuales por librería en Starlight se completan en M4; las páginas de API Reference en M3.2.

18. Repositorio Fuente, Licencia y Contribución#

Publicado bajo Licencia MIT. Todos los ensamblados cumplen los invariantes de compilación EricksonLopez.*: importaciones explícitas, firma fuerte (`EricksonLopez.snk`) y metadatos de autor en ASCII (`Erickson Lopez`).

19. Resolución de Problemas, Riesgos y Migración#

  • El núcleo, Dapper.Aot y 5 compiladores de dialecto son Full AOT; SqlBuilder.Dapper, SqlBuilder.Oracle y SqlBuilder.Testing declaran IsAotCompatible=false.
  • Desfase de versiones detectado: la última versión publicada en NuGet.org es v2.0.0, mientras el HEAD del repositorio local está en v3.0.0.

20. Evidencia de Calidad y Verificación#

Firma Fuerte (`EricksonLopez.snk`)
EricksonLopez.snk
`ImplicitUsings=disable`
disable
Extracción de Documentación XML
Verificado (34 namespaces, 244 tipos, 1452 miembros)
Atributos MSBuild AOT / Trimming
11 Full / 0 Partial / 3 Incompatible / 2 N/A
Artefactos BenchmarkDotNet
3 total (3 measured, 0 na_error)

Límites Explícitos de Verificación y Alcance

  • Todas las mediciones verificadas provienen estrictamente de `BenchmarkDotNet.Artifacts` ejecutados sobre .NET RyuJIT (existen 0 ejecuciones NativeAOT en esta instantánea).

Buscar en el Ecosistema EricksonLopez.*

Escribe el nombre de una librería, ID de paquete NuGet, tipo .NET o concepto arquitectónico para buscar en el portal.