bjbr-dev / PeregrineDb

CRUD Extensions for Dapper.Net
MIT License
23 stars 4 forks source link
dapper

PeregrineDb - Lightweight CRUD Extensions for Dapper.Net

Image of a Peregrine, from the RSPB

PeregrineDb is a small and fast Dapper.Net extension library to perform CRUD statement with POCO models.

Build status

Project aims

  1. Provide fast and lightweight CRUD extensions for Dapper
  2. Should be able to run against multiple different databases in the same project
  3. 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.

DBMS Support

Currently, the following DBMS are supported. More will be added (e.g. SQLite) when there is demand for them:

Features

Don't forget, for practical examples of usage, you can also browse our extensive unit tests suite.

Comparison

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)
:heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
  • Can work across multiple DBMS in same project
  • Throws exceptions for inconsistencies (E.g. Update not affected anything)
Dapper.Contrib Get
GetAll
Insert
Update
Delete(All)
:heavy_check_mark: :heavy_check_mark:
  • Can use interfaces to track changes
Dapper.Extensions Get
Insert
Update
Delete
GetList
GetPage/GetSet
Count
:heavy_check_mark:
  • Can use simple lambdas and predicates
  • Generates GUID keys
  • Can be configured without attributes
Dapper.FastCRUD Insert
Get
Find(Equivalent to GetRange)
(Bulk)Update
(Bulk)Delete
Count
:heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
  • Has a nice fluent syntax for complex WHERE operations
  • Can be configured without attributes
Dapper.SimpleCRUD Get
GetList
GetListPaged
Insert
Update
Delete(List)
RecordCount
:heavy_check_mark:
  • Can create WHERE clauses from objects
  • Generates GUID keys

Installation

Simply add the nuget package PeregrineDb to your project.

Licensing and Attribution

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.