DBBroker 3.0.5
Prefix Reserveddotnet add package DBBroker --version 3.0.5
NuGet\Install-Package DBBroker -Version 3.0.5
<PackageReference Include="DBBroker" Version="3.0.5" />
<PackageVersion Include="DBBroker" Version="3.0.5" />
<PackageReference Include="DBBroker" />
paket add DBBroker --version 3.0.5
#r "nuget: DBBroker, 3.0.5"
#:package DBBroker@3.0.5
#addin nuget:?package=DBBroker&version=3.0.5
#tool nuget:?package=DBBroker&version=3.0.5
DBBroker 3.x

A lightweight and easy to use .NET tool and library for effortless database records manipulation.
Benefits
- Automatically generated Data Models
- Zero-SQL
- Compile time database schemas compatibility and change check
NuGet
| Package | Latest | |
|---|---|---|
| DBBroker | .NET Standard 2.0 | |
| DBBroker.Cli |
Version 3.x has no backward compatibility with DBBroker 1.x and 2.x
How it works?
DBBroker approach is powerful and different from other ORMs because it associates a .NET CLI tool to automatically generate Data Models and a library that uses those Data Models at runtime to generate SQL and manipulate database records.
Philosophy
DBBroker offers features that benefit any kind of .NET application that interacts with databases, from the simplest to the most complex, particularly in security-restricted scenarios. Here are some key requirements it addresses that other ORMs fail:
Applications should NOT be executing DDL.
Applications' Data Access Objects should act as clients to the database, not the other way around.
Schema Migrations are not an option due to a development process led by Database Administrators.
These are common requirements for many organizations or database-centered solutions, and, arguably, by everyone who likes to keep things simple.
Quick Start⚡
Open your terminal and navigate to your application's *.csproj directory. Then follow these steps:
Step 1: Install DBBroker.Cli .NET tool globally.
dotnet tool install DBBroker.Cli --global
Step 2: Add DBBroker package to your project.
dotnet nuget add DBBroker
Step 3: Create a dbbroker.config.json file at the root of your project.
dbbroker init --namespace="MyApp.DataModels" --connection-string "<my_connection_string>" --provider Oracle
Step 4: Synchronize your project with your database schemas to generate the Data Models.
dbbroker sync
Examples
Entity persistence.
// Data Models classes are generated by DBBroker (dbbroker sync)
var customer = new CustomersDataModel();
customer.Name = "John Three Sixteen";
customer.Birthday = new DateTime(1980, 3, 16);
var id = await dbConnection.InsertAsync(customer);
Entity persistence with transactions.
using var dbConnection = new SqlConnection();
dbConnection.Open();
var transaction = dbConnection.GetTransaction();
try
{
var customer = new CustomersDataModel();
customer.Id = Guid.NewGuid();
customer.Name = "John Three Sixteen";
customer.Birthday = new DateTime(1980, 3, 16);
await dbConnection.InsertAsync(customer, transaction);
var car = new CarsDataModel();
car.Model = "Renault Twingo";
car.Year = 2001;
car.CustomerId = customer.Id;
await dbConnection.InsertAsync(car, transaction);
transaction.Commit();
}
catch(Exception ex)
{
transaction.Rollback();
}
Retrieving a record.
var result = await dbConnection
.Select<CustomersDataModel>()
.AddFilter(x => x.Id, SqlEquals.To("1e6fc0e6-1fe2-49c0-ba37-ec14bf8eddc4"))
.ExecuteAsync();
var customer = result.FirstOrDefault();
Retrieving multiple and filtered records.
var inactiveCustomers = await dbConnection.Select<CustomersDataModel>()
.AddFilter(x => x.StatusId, SqlEquals.To(3))
.ExecuteAsync();
Retrieving multiple records loading only specified columns.
var inactiveCustomers = await dbConnection
.Select<CustomersDataModel>([
x => x.Id,
x => x.Name,
x => x.Birthday
])
.OrderBy(x => x.Name)
.AddFilter(x => x.StatusId, SqlEquals.To(3))
.ExecuteAsync();
Supported Databases
| Database | Status | --provider |
|---|---|---|
| SQL Server | ✅ | SqlServer |
| Oracle | ✅ | Oracle |
| Postgres | ⚒️ | Postgres |
| MySQL | 🛣️ | MySql |
Contribute
All contributions are appreciated, whether they're bug reports, feature suggestions, or pull requests. Thank you for your interest and support in improving this project!
Financial support is also welcome, whether large or small contributions will help to keep this project moving and always secure.
| 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
- Contrib.Bcl.Ranges (>= 1.0.0)
- Dapper (>= 2.1.35)
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.5 | 154 | 12/13/2025 |
| 3.0.4 | 410 | 12/11/2025 |
| 3.0.3 | 406 | 12/11/2025 |
| 3.0.2-beta | 403 | 12/11/2025 |
| 3.0.0-beta | 183 | 1/29/2025 |
| 2.0.8 | 905 | 7/2/2020 |
| 2.0.7 | 688 | 6/26/2020 |
| 2.0.4-beta | 892 | 10/11/2018 |
| 1.1.0 | 2,958 | 8/24/2015 |
| 1.0.4 | 2,077 | 7/21/2015 |
| 1.0.3 | 1,910 | 7/20/2015 |
| 1.0.2 | 1,486 | 7/13/2015 |
| 1.0.0 | 1,525 | 7/10/2015 |