Suilder¶
Suilder is a SQL query builder for .NET.
It is focused on the use of alias objects to reference tables and column names, there are different types of alias, that can use strings or lambda expressions, and support translation of names. The queries are built by combining smaller query fragments, allowing us to build dynamic queries easily.
This library is only a query builder, so you have to combine with any other library to execute the queries and mapping the result.
Installing¶
Package | Nuget | Download (full) |
---|---|---|
Suilder | ||
Suilder.Engines | Use full release. |
Starting¶
At the start of your application:
// Register your builder (only one per application because is registered globally)
ISqlBuilder sql = SqlBuilder.Register(new SqlBuilder());
// Initialize the SqlExp class to use their functions in lambda expressions (optional)
SqlExp.Initialize();
// Create a table builder and add your entity classes (optional)
ITableBuilder tableBuilder = new TableBuilder();
tableBuilder.Add<Person>();
tableBuilder.Add<Department>();
// Create an engine to compile the queries
IEngine engine = new SQLServerEngine(tableBuilder);
Configuration¶
General¶
- The builder
- Operators
- Case when
- Functions
- Query
- Select
- From, join and CTE
- Where and having
- Group by
- OrderBy
- Offset and limit
- Insert
- Update
- Delete
- Raw SQL
- Data types
Examples¶
Release notes¶
See release notes.