Sequel 1.0.2
See the version list below for details.
dotnet add package Sequel --version 1.0.2
NuGet\Install-Package Sequel -Version 1.0.2
<PackageReference Include="Sequel" Version="1.0.2" />
<PackageVersion Include="Sequel" Version="1.0.2" />
<PackageReference Include="Sequel" />
paket add Sequel --version 1.0.2
#r "nuget: Sequel, 1.0.2"
#:package Sequel@1.0.2
#addin nuget:?package=Sequel&version=1.0.2
#tool nuget:?package=Sequel&version=1.0.2
sequel
sequel is an expressive SQL query builder, with syntax that emulates writing actual SQL queries.
Basic Usage
SELECT
var sqlBuilder = new SqlBuilder()
.Select("Id", "Salary")
.From("dbo.Test");
var sql = sqlBuilder.ToSql(); // .ToString() also works
/*
SELECT Id, Salary FROM dbo.Test
*/
INSERT
var sqlBuilder = new SqlBuilder()
.Insert("dbo.Test")
.Columns("Name", "Salary")
.Values("'John'", "50").Values("'Jane'", "100");
var sql = sqlBuilder.ToSql(); // .ToString() also works
/*
INSERT INTO dbo.Test (Name, Salary) VALUES ('John', 50), ('Jane', 100)
*/
UPDATE
var sqlBuilder = new SqlBuilder()
.Update("dbo.Test")
.Set("Salary = 100", "ManagerId = 2")
.Where("EmployeeId = 1");
var sql = sqlBuilder.ToSql(); // .ToString() also works
/*
UPDATE dbo.Test SET Salary = 100, ManagerId = 2 WHERE EmployeeId = 1
*/
DELETE
var sqlBuilder = new SqlBuilder()
.Delete()
.From("dbo.Test")
.Where("EmployeeId = 1");
var sql = sqlBuilder.ToSql(); // .ToString() also works
/*
DELETE FROM dbo.Test WHERE EmployeeId = 1
*/
Templating
sequel has built-in templates to support the actions listed above, but also supports custom templating for edge cases. To formulate the SQL string, sequel uses || delimiters surrounding the following keywords:
||select||||from||||join||||where||||groupby||||having||||orderby|||insert||||columns||||values|||update||||set||||delete||
To use SqlBuilder with a custom template, provide the template when constructing new SqlBuilder("YOUR CUSTOM TEMPLATE").
The default templates are as follows:
Select
||select|| ||from|| ||join|| ||where|| ||groupby|| ||having|| ||orderby||
Insert
||insert|| ||columns|| ||values||
Update
||update|| ||set|| ||where||
Delete
||delete|| ||from|| ||join|| ||where||
Usage with dapper.net
using(var conn = new SqlConnection("your connection string")
{
var sqlBuilder = new SqlBuilder()
.Select("Id", "Salary")
.From("dbo.Test")
.Where("Id", "@Id");
var sql = sqlBuilder.ToSql(); // .ToString() also works
/*
SELECT Id, Salary FROM dbo.Test WHERE Id = @Id
*/
var result = conn.Query(sql, new { Id = 1 });
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Sequel:
| Package | Downloads |
|---|---|
|
NBean
Hybrid-ORM for .Net |
|
|
LunchPail.Repository
A .NET Standard compliant abstract repository for use with LunchPail. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.1.4 | 7,516 | 9/16/2022 |
| 3.1.3 | 3,413 | 9/16/2022 |
| 3.1.2 | 3,380 | 9/16/2022 |
| 3.1.1 | 11,802 | 7/31/2021 |
| 3.1.0 | 11,862 | 12/4/2020 |
| 3.0.2 | 11,759 | 11/30/2020 |
| 3.0.1 | 11,837 | 11/15/2020 |
| 3.0.0 | 11,758 | 11/14/2020 |
| 2.0.0 | 4,426 | 10/28/2019 |
| 1.1.5 | 3,850 | 3/20/2019 |
| 1.1.4 | 3,664 | 3/5/2019 |
| 1.1.3 | 4,162 | 8/31/2018 |
| 1.1.2 | 3,861 | 8/24/2018 |
| 1.1.1 | 3,867 | 8/24/2018 |
| 1.1.0 | 3,829 | 8/23/2018 |
| 1.0.6 | 3,839 | 8/23/2018 |
| 1.0.5 | 6,188 | 8/21/2018 |
| 1.0.4 | 4,241 | 7/26/2018 |
| 1.0.3 | 4,004 | 7/25/2018 |
| 1.0.2 | 4,253 | 5/5/2018 |