Skip to content

mikependon/RepoDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4,030 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Version MsTeams

RepoDB — a Hybrid ORM for .NET

RepoDB is a fast, lightweight, and open-source .NET ORM that gives you the best of both worlds: the simplicity of a micro-ORM and the power of a full ORM — without the overhead.

Write raw SQL when you need full control. Use fluent methods when you want productivity. Switch between them freely, in the same codebase.

Packages and Build Status

Project Nuget Downloads Status
RepoDb Build
RepoDb.SqlServer Build
RepoDb.MySql Build
RepoDb.MySqlConnector Build
RepoDb.PostgreSql Build
RepoDb.Sqlite.Microsoft Build
RepoDb.SqlServer.BulkOperations Build
RepoDb.PostgreSql.BulkOperations Build
RepoDb.Telemetry.Core Build
RepoDb.Telemetry.Default Build

Why RepoDB?

Expand to learn more

Easy to Use — all operations are extension methods on IDbConnection. Open a connection and you're ready to go.

High Performance — compiled expressions are cached and reused. RepoDB understands your schema to generate the most efficient execution path ahead of time.

Memory Efficient — object properties, execution contexts, mappings, and SQL statements are extracted once and reused throughout the lifetime of your application.

Hybrid by Design — use fluent methods for everyday CRUD, drop down to raw SQL for complex queries, or mix both — all within the same connection.

Battle-Tested — backed by thousands of unit and integration tests, and used in production systems worldwide.

Always Free — Apache 2.0 licensed, forever open source.

Get Started

Choose your database and follow the quick-start guide:

Explore individual features in the documentation.

Supported Databases

Raw SQL execution methods work with any ADO.NET-compatible provider:

Fluent operations (Query, Insert, Merge, Delete, Update, and more) are supported for SQL Server, MySQL, PostgreSQL, and SQLite.

Type Coercion

RepoDB uses ADO.NET's native coercion by default, keeping type mismatches visible and explicit. To enable automatic conversion:

RepoDb.Converter.ConversionType = ConversionType.Automatic;

How RepoDB Compares

RepoDB sits between a micro-ORM and a full ORM. Each tool below makes different tradeoffs — pick the one that fits your project:

RepoDB Dapper Entity Framework
Abstraction level Hybrid — fluent CRUD + raw SQL Micro-ORM — raw SQL mapping Full ORM — LINQ, change tracking
Fluent CRUD API Yes (Insert, Query, Update, Delete, Merge, more) No — SQL per call Yes, via LINQ/DbSet
Raw SQL Yes, mixed freely with fluent calls Yes — its core model Yes, via FromSql
Change tracking None None Yes
Migrations None built-in None built-in Yes (EF Migrations)
Bulk operations Built-in, cross-provider Via extensions Via extensions/third-party
Insights / telemetry Built-in (RepoDb.Telemetry.Default) None built-in — manual or third-party (e.g. MiniProfiler) Built-in logging/interceptors; OTel via community packages
Performance Close to raw ADO.NET Close to raw ADO.NET Overhead from tracking/materialization
Best fit EF-like productivity without losing SQL control Thinnest possible SQL-to-object mapper Rich object graphs, LINQ, migrations

Dapper and Entity Framework are both excellent, mature tools — this reflects design tradeoffs, not a ranking.

Telemetry

RepoDB includes opt-in, drop-in telemetry via RepoDb.Telemetry.Default. Enable it once at startup and every operation (Insert, Query, Update, Delete, etc.) is captured and published to your insights collector automatically — no custom ITrace required.

GlobalConfiguration
    .Setup(new GlobalConfigurationOptions { UseRegisteredGlobalTraces = true })
    .UseDefaultTelemetry(
        host: "https://your-collector-host",
        apiKey: "YOUR_API_KEY",
        applicationName: "MyApp",
        groupName: "Default");

It's intentionally lightweight rather than OTel-based, keeping RepoDB's thin, fast footprint intact. See the package README for configuration options, the full OTel rationale, and the roadmap.

Contributions

We welcome contributions of all kinds — code, docs, bug reports, and ideas.

Community

Resources

Contributors

Credits

Thanks to all contributors and to Scott Hanselman for featuring RepoDB.

Tools and projects that make RepoDB possible: GitHub, Microsoft Teams, Moq, NuGet, RawDataAccessBencher, Shields, Microsoft.Data.Sqlite, System.Data.SQLite.Core, MySql.Data, MySqlConnector, Npgsql.

License

Apache-2.0 — Copyright © 2018 Michael Camara Pendon