-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Marcus Ackre Medina edited this page Sep 13, 2026
·
4 revisions
Fluent SQL query builder — build parameterized SQL strings in a readable, chainable API.
dotnet add package MarcusMedina.Fluent.Data.SqlThis came from watching my students struggle with writing SQL by hand. I designed this to help them along the way — though, cheekily, before the course ended they still had to wrestle with raw query strings anyway.
In this case, I wanted a builder that produces the exact same parameterised SQL a student would eventually have to write themselves, so it doubles as a way to check your own work.
- New to SQL? Build queries step by step and read back the exact parameterised SQL you'll eventually need to write by hand — a safe way to check your own work.
- Professional? Dynamic query building for data-access layers where a full ORM is more than you need, with parameterisation baked in so SQL injection isn't something you have to remember to prevent.
- Getting Started — install and your first SELECT
-
API Overview — the full
Sqlmethod surface - Advanced Usage — joins, OR chains, and cross-dialect paging
using MarcusMedina.Fluent.Data.Sql;
var sql = new Sql(DatabaseType.PostgreSQL)
.Table("users")
.Select("name", "age")
.When("age > 18")
.OrderBy("name")
.Build();
// SELECT "name", "age" FROM "users" WHERE age > 18 ORDER BY "name" ASC;