MVFC.SQLCraft
3.0.8
dotnet add package MVFC.SQLCraft --version 3.0.8
NuGet\Install-Package MVFC.SQLCraft -Version 3.0.8
<PackageReference Include="MVFC.SQLCraft" Version="3.0.8" />
<PackageVersion Include="MVFC.SQLCraft" Version="3.0.8" />
<PackageReference Include="MVFC.SQLCraft" />
paket add MVFC.SQLCraft --version 3.0.8
#r "nuget: MVFC.SQLCraft, 3.0.8"
#:package MVFC.SQLCraft@3.0.8
#addin nuget:?package=MVFC.SQLCraft&version=3.0.8
#tool nuget:?package=MVFC.SQLCraft&version=3.0.8
MVFC.SQLCraft
Base library for SQL database abstraction and manipulation in .NET 9.0+.
Provides interfaces, utilities, and integration with SqlKata.
Installation
dotnet add package MVFC.SQLCraft
Features
- SQL driver abstraction
- Multi-database integration
- Connection factory
Main Methods
// Return a single object
T? QueryFirstOrDefault<T>(Query query, IDbTransaction? tx = null);
Task<T?> QueryFirstOrDefaultAsync<T>(Query query, IDbTransaction? tx = null, CancellationToken ct = default);
// Return multiple objects
IEnumerable<T> Query<T>(Query query, IDbTransaction? tx = null);
Task<IEnumerable<T>> QueryAsync<T>(Query query, IDbTransaction? tx = null, CancellationToken ct = default);
// Execute a query and return affected rows
int Execute(Query query, IDbTransaction? tx = null);
Task<int> ExecuteAsync(Query query, IDbTransaction? tx = null, CancellationToken ct = default);
// Execute a raw query and return affected rows
int Execute(string sql, IDbTransaction? tx = null);
Task<int> ExecuteAsync(string sql, IDbTransaction? tx = null, CancellationToken ct = default);
// Perform a transaction
void ExecuteInTransaction(Action<SQLCraftDriver, IDbTransaction> action, IsolationLevel isolation = IsolationLevel.ReadCommitted);
Task ExecuteInTransactionAsync(Func<SQLCraftDriver, IDbTransaction, CancellationToken, Task> action, IsolationLevel isolation = IsolationLevel.ReadCommitted, CancellationToken ct = default);
Transaction Example
await driver.ExecuteInTransactionAsync(async (x, t, ct) => {
await x.ExecuteAsync(new Query("Person")
.AsInsert(new
{
Name = "Bob"
}), t, ct);
var sel = new Query("Person")
.Select("Id", "Name")
.Where("Name", "Bob");
var p = await x.QueryFirstOrDefaultAsync<Person>(sel, t, ct);
Assert.NotNull(p);
var upd = new Query("Person")
.Where("Id", p!.Id)
.AsUpdate(new
{
Name = "Robert"
});
var upaff = await x.ExecuteAsync(upd, t, ct);
Assert.Equal(1, upaff);
var sel2 = new Query("Person")
.Select("Id", "Name")
.Where("Id", p.Id);
var p2 = await x.QueryFirstOrDefaultAsync<Person>(sel2, t, ct);
Assert.NotNull(p2);
Assert.Equal("Robert", p2!.Name);
});
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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 is compatible. 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. |
-
net10.0
- sqlkata (>= 4.0.1)
- sqlkata.execution (>= 4.0.1)
-
net9.0
- sqlkata (>= 4.0.1)
- sqlkata.execution (>= 4.0.1)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on MVFC.SQLCraft:
| Package | Downloads |
|---|---|
|
MVFC.SQLCraft.MsSQL
MVFC.SQLCraft.MsSQL: Extensão para acesso Microsoft SQL Server usando MVFC.SQLCraft. Integração simplificada e segura para bancos SQL Server em .NET 9. |
|
|
MVFC.SQLCraft.Mysql
MVFC.SQLCraft.Mysql: Extensão para acesso MySQL usando MVFC.SQLCraft. Integração simplificada e segura para bancos MySQL em .NET 9. |
|
|
MVFC.SQLCraft.PostgreSql
MVFC.SQLCraft.PostgreSql: Extensão para acesso PostgreSQL usando MVFC.SQLCraft. Fornece integração simplificada e segura para bancos PostgreSQL em .NET 9. |
|
|
MVFC.SQLCraft.SQLite
MVFC.SQLCraft.SQLite: Extensão para acesso SQLite usando MVFC.SQLCraft. Integração simplificada e segura para bancos SQLite em .NET 9. |
|
|
MVFC.SQLCraft.Firebird
MVFC.SQLCraft.Firebird: Extensão para acesso Firebird usando MVFC.SQLCraft. Integração simplificada e segura para bancos Firebird em .NET 9. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.8 | 0 | 3/15/2026 |
| 3.0.7 | 0 | 3/15/2026 |
| 3.0.6 | 38 | 3/12/2026 |
| 3.0.5 | 34 | 3/12/2026 |
| 3.0.4 | 34 | 3/12/2026 |
| 3.0.3 | 42 | 3/11/2026 |
| 3.0.2 | 40 | 3/11/2026 |
| 3.0.1 | 43 | 3/11/2026 |
| 2.0.1 | 167 | 2/20/2026 |
| 1.1.1 | 339 | 11/16/2025 |
| 1.1.0 | 338 | 11/16/2025 |
| 1.0.4 | 247 | 10/30/2025 |
| 1.0.3 | 237 | 10/12/2025 |
| 1.0.1 | 216 | 10/12/2025 |