PeregrineDb is a small and fast Dapper.Net extension library to perform CRUD statement with POCO models.
- Provide fast and lightweight CRUD extensions for Dapper
- Should be able to run against multiple different databases in the same project
- Thread safety should be guarenteed
I was using the fantastic Dapper.SimpleCRUD library and found it incredibly easy to use. However, two things drove me to write this library - I have a project which uses SqlServer and Postgres databases side-by-side, and unfortunately Dapper.SimpleCRUD does not support this. Second, I found it was missing a few crucial optimizations which was doubling the time taken to easily insert many rows.
Currently, the following DBMS are supported. More will be added (e.g. SQLite) when there is demand for them:
- Microsoft SqlServer 2012 and above
- PostgreSQL
- Getting Started
- CRUD Methods
- Creating: Insert one or many entities, with or without generating a primary key.
- Counting: Count how many entities match some conditions
- Reading an Entity: Many overloads for searching for a single entity.
- Reading many Entities: Search for any number of entities matching arbitrary conditions. Includes pagination.
- Updating: Update one or many entities, matched on primary key
- Deleting: Delete one, many or all entities
- Testing your code
- DataWiper
- Contributing
Don't forget, for practical examples of usage, you can also browse our extensive unit tests suite.
NB: These may not be correct nor up-to-date. I made this comparison very quickly
Library | Operations | Composite Keys | Async | .Net Core | Notes |
---|---|---|---|---|---|
PeregrineDb | Count Find/Get Get(Range/All) GetPage Insert(Range) Update(Range) Delete(Range/All) |
✔️ | ✔️ | ✔️ |
|
Dapper.Contrib | Get GetAll Insert Update Delete(All) |
✔️ | ✔️ |
|
|
Dapper.Extensions | Get Insert Update Delete GetList GetPage/GetSet Count |
✔️ |
|
||
Dapper.FastCRUD | Insert Get Find(Equivalent to GetRange) (Bulk)Update (Bulk)Delete Count |
✔️ | ✔️ | ✔️ |
|
Dapper.SimpleCRUD | Get GetList GetListPaged Insert Update Delete(List) RecordCount |
✔️ |
|
Simply add the nuget package PeregrineDb to your project.
This project can be used and distributed under the MIT License.
Please read Notice for licenses of other projects used by or inspirations of this projects.