Info
| Version: | 1.2.0 |
| Author(s): | Dmitry Tikhonov |
| Last Update: | Wednesday, April 1, 2026 |
| .NET Fiddle: | Online Example |
| Project Url: | https://github.com/0x1000000/SqExpress |
| NuGet Url: | https://www.nuget.org/packages/SqExpress |
Install
Install-Package SqExpress
dotnet add package SqExpress
paket add SqExpress
SqExpress Download (Unzip the "nupkg" after downloading)
Dependencies
Tags
It lets you build SQL directly in C# with strong typing and IntelliSense, while keeping the code close to real SQL and avoiding LINQ translation.
Key features:
- Strongly typed SQL AST with export to MS T-SQL, PostgreSQL, and MySQL
- Complex query building with joins, subqueries, CTEs, set operators, analytic/window functions, and MERGE-style workflows
- Syntax tree traversal and modification for dynamic query scenarios
- T-SQL parser (`SqTSqlParser`) for importing supported SQL into SqExpress AST
- Fail-closed validation and security-predicate rewriting workflows for AI-generated T-SQL within the supported parser surface
- T-SQL to SqExpress transpilation, analyzer support, and code fixes
- Table descriptors, create/drop script generation, and DTO/SqModel generation
- Database-first scaffolding for table descriptors and models
- Live database metadata retrieval and table-list comparison with flags-based diff/inclusion helpers
- Foreign-key graph navigation and join-path discovery with `TablesGraph`
- Lightweight ADO.NET-based data access for MS SQL Client, Npgsql, and MySQL connectors
SqExpress works well for both code-first and database-first workflows.
Here's an article that explains the library principles: ["Syntax Tree and Alternative to LINQ in Interaction with SQL Databases"](https://itnext.io/syntax-tree-and-alternative-to-linq-in-interaction-with-sql-databases-656b78fe00dc?source=friends_link&sk=f5f0587c08166d8824b96b48fe2cf33c).