RepoDb is an open-source .NET ORM that bridge the gaps between micro-ORMs and macro-ORMs. It helps the developer to simplify the switch-over of when to use the “BASIC” and “ADVANCE” operations during the development.
It is the best alternative ORM to both Dapper and EntityFramework.
Why use RepoDb as your ORM?
-
Usabilities and Benefits
- The installation is easy and fast! It can then be used right-away.
- The layer like DbContext is eliminated, those make the developers speed-up the usability.
- The calls to Fluent and Raw-SQL method is just a dot away.
- The implementation of Repository becoming more simpler by leveraging the built-in repositories.
- The support to dynamics is rich; can work without the models.
- The processes to handle the large datasets is very-simple with Batch and Bulk operations.
- The round-trips to the database is being minimized with 2nd-Layer cache.
- The transmission of the data from different RDBMS DB Providers only take few lines of codes.
- The column transformation can be customized with Property Handlers.
-
Features and Capabilities
- The 2nd-layer cache has been introduced; can be customized.
- The tracing has been introduced; can be customized.
- The support to dynamics is rich.
- The batch-operations were introduced; being executed through packed-statements and is ACID.
- The bulk-operations were introduced and is leveraging the ADO.NET implementations.
- The usage of expression is present in most operations.
- The statement builder can be customized. The developers can override the default implementation.
- The repositories were introduced; can be leveraged for actual implementation.
- The hints were introduced to optimize the help query analyzers.
- The asynchronous operations are present in all operations.
- The equivalent table-based operations are present for most operations.
-
Important Stories to Read
- Please visit the official RepoDb vs Dapper blog at DEV.to.
RepoDb operations were implemented as extended methods of IDbConnection object. As long as the database connection is open, the developers can do all the activities towards the database.
RepoDb has its own compiler and pre-caches the already-generated compiled-ILs and compiled-Expressions for future reusabilities.
RepoDb extracts and caches the object properties, mappings and SQL statements and reusing them throughout the process of transformations and executions. It helps eliminate the creation of unnecessary objects that leads to a low memory consumption.
RepoDb is rapidly expanding its capabilities and features to become the main-stream hybrid-ORM for .NET. Though it is not a macro-ORM, it really requires significant amount of time and effort to maintain.
It is always open for community contributions, so please help us build and realize the solution.
We would like to build a healthy and active community that would help fellow .NET developers build the knowledge-base when it comes to database accessibility. Please get in touch with us via:
- GitHub - for any issues, requests and problems.
- StackOverflow - for any technical questions.
- Twitter - for the latest news.
- Gitter Chat - for direct and live Q&A.
To contribute, please open the issues tab and filter the list of items with for-grabs label. Otherwise, please create a new issue for us to look-at and discuss.
Your biggest contribution is to utilize and share this solution to other developers. You can:
- Blog it
- Discuss it
- Document it
- Share it
- Use it
We are really thanking you for that!
- Building the Solutions - let us build your copies.
- Coding Standards - let us be uniformed.
- Reporting an Issue - let us organize for easy tracking and fixing.
The pull-requests must be done on the following code-lines (RepoDb.Core, RepoDb.SqlServer, RepoDb.SqLite, RepoDb.MySql and RepoDb.PostgreSql).
Project/Solution | Build | Version | Unit Tests | IntegrationTests |
---|---|---|---|---|
Core | ||||
SqlServer | ||||
SqLite | ||||
MySql | ||||
PostgreSql | ||||
SqlServer (Bulk) | - |
Practically, RepoDb has supported all RDBMS data-providers. Developers has the freedom to write their own SQL statements and execute it against the database through the Execute() methods mentioned below.
RepoDb has “fluent” methods in which the SQL Statements are automatically being constructed as part of the execution context. These methods are the most common operations being used by most developers (please see the operations section). In this regards, RepoDb only fully supported the SQL Server, SQLite, MySQL and PostgreSQL RDBMS data providers.
RepoDb is a highly extensible to further support customizations. You can:
- Customize the Cache
- Create a customized Property Handler
- Implement a Trace
- Extending the supports for specific DB Provider
And many more extensibility possibilities.
Operation | Normal | Normal (Async) | TableName | TableName (Async) | Packed Execution | Data Providers |
---|---|---|---|---|---|---|
Average | YES | YES | YES | YES | NO | SUPPORTED |
AverageAll | YES | YES | YES | YES | NO | SUPPORTED |
BatchQuery | YES | YES | YES | YES | NO | SUPPORTED |
BulkDelete | YES | YES | YES | YES | NO | SQLSVR |
BulkInsert | YES | YES | YES | YES | NO | SQLSVR |
BulkMerge | YES | YES | YES | YES | NO | SQLSVR |
BulkUpdate | YES | YES | YES | YES | NO | SQLSVR |
Count | YES | YES | YES | YES | NO | SUPPORTED |
CountAll | YES | YES | YES | YES | NO | SUPPORTED |
Delete | YES | YES | YES | YES | NO | SUPPORTED |
DeleteAll | YES | YES | YES | YES | NO | SUPPORTED |
ExecuteNonQuery | YES | YES | NO | NO | NO | ALL |
ExecuteQuery | YES | YES | NO | NO | NO | ALL |
ExecuteQueryMultiple | YES | YES | NO | NO | NO | ALL |
ExecuteReader | YES | YES | NO | NO | NO | ALL |
ExecuteScalar | YES | YES | NO | NO | NO | ALL |
Exists | YES | YES | YES | YES | NO | SUPPORTED |
Insert | YES | YES | YES | YES | NO | SUPPORTED |
InsertAll | YES | YES | YES | YES | YES | SUPPORTED |
Max | YES | YES | YES | YES | NO | SUPPORTED |
MaxAll | YES | YES | YES | YES | NO | SUPPORTED |
Merge | YES | YES | YES | YES | NO | SUPPORTED |
MergeAll | YES | YES | YES | YES | YES | SUPPORTED |
Min | YES | YES | YES | YES | NO | SUPPORTED |
MinAll | YES | YES | YES | YES | NO | SUPPORTED |
Query | YES | YES | YES | YES | NO | SUPPORTED |
QueryAll | YES | YES | YES | YES | NO | SUPPORTED |
QueryMultiple | YES | YES | NO | NO | YES | SUPPORTED |
Sum | YES | YES | YES | YES | NO | SUPPORTED |
SumAll | YES | YES | YES | YES | NO | SUPPORTED |
Truncate | YES | YES | YES | YES | NO | SUPPORTED |
Update | YES | YES | YES | YES | NO | SUPPORTED |
UpdateAll | YES | YES | YES | YES | YES | SUPPORTED |
To learn more about these operations, please visit our reference implementations page.
The benchmark result to be shown on this page will always be referring to the community-approved ORM bencher tool (the RawDataAccessBencher tool).
Results below is the actual recent official execution result.
This section will always be updated with the latest official result.
- AppVeyor - for the builds and test-executions.
- GitHub - for hosting this project.
- Gitter - for the community engagements.
- Moq - for being the tests mocking framework.
- Nuget - for the package deliveries.
- RawDataAccessBencher - for measuring the performance and efficiency.
- ReadTheDocs - for the library documentations.
- SharpLab - for helping us on our IL coding.
- Shields - for the awesome badges.
- StackEdit - for being the markdown file editor.
- System.Data.SQLite, MySql.Data, Npgsql - for being the extended DB provider drivers.
Apache-2.0 - Copyright © 2019 - Michael Camara Pendon