MVFC.SQLCraft
3.0.5
See the version list below for details.
dotnet add package MVFC.SQLCraft --version 3.0.5
NuGet\Install-Package MVFC.SQLCraft -Version 3.0.5
<PackageReference Include="MVFC.SQLCraft" Version="3.0.5" />
<PackageVersion Include="MVFC.SQLCraft" Version="3.0.5" />
<PackageReference Include="MVFC.SQLCraft" />
paket add MVFC.SQLCraft --version 3.0.5
#r "nuget: MVFC.SQLCraft, 3.0.5"
#:package MVFC.SQLCraft@3.0.5
#addin nuget:?package=MVFC.SQLCraft&version=3.0.5
#tool nuget:?package=MVFC.SQLCraft&version=3.0.5
MVFC.SQLCraft
Biblioteca base para abstração e manipulação de bancos de dados SQL no .NET 9.0+.
Fornece interfaces, utilitários e integração com SqlKata.
Instalação
dotnet add package MVFC.SQLCraft
Recursos
- Abstração de drivers SQL
- Integração com múltiplos bancos
- Factory para criação de conexões
Principais Métodos
// Retornar só um objeto
T? QueryFirstOrDefault<T>(Query query, IDbTransaction? tx = null);
Task<T?> QueryFirstOrDefaultAsync<T>(Query query, IDbTransaction? tx = null, CancellationToken ct = default);
// Retornar múltiplos objetos
IEnumerable<T> Query<T>(Query query, IDbTransaction? tx = null);
Task<IEnumerable<T>> QueryAsync<T>(Query query, IDbTransaction? tx = null, CancellationToken ct = default);
// Executar uma query e retornar linhas afetadas
int Execute(Query query, IDbTransaction? tx = null);
Task<int> ExecuteAsync(Query query, IDbTransaction? tx = null, CancellationToken ct = default);
// Executar uma query bruta e retornar linhas afetadas
int Execute(string sql, IDbTransaction? tx = null);
Task<int> ExecuteAsync(string sql, IDbTransaction? tx = null, CancellationToken ct = default);
// Realizar uma transação
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);
Exemplo de transação
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);
});
Licença
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.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.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.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.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.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.1.1 | 165 | 4/5/2026 |
| 3.1.0 | 186 | 4/2/2026 |
| 3.0.9 | 164 | 3/21/2026 |
| 3.0.8 | 192 | 3/15/2026 |
| 3.0.7 | 187 | 3/15/2026 |
| 3.0.6 | 183 | 3/12/2026 |
| 3.0.5 | 182 | 3/12/2026 |
| 3.0.4 | 178 | 3/12/2026 |
| 3.0.3 | 185 | 3/11/2026 |
| 3.0.2 | 180 | 3/11/2026 |
| 3.0.1 | 188 | 3/11/2026 |
| 2.0.1 | 176 | 2/20/2026 |
| 1.1.1 | 350 | 11/16/2025 |
| 1.1.0 | 346 | 11/16/2025 |
| 1.0.4 | 255 | 10/30/2025 |
| 1.0.3 | 242 | 10/12/2025 |
| 1.0.1 | 220 | 10/12/2025 |