Skip to content

justinhachemeister/PeregrineDb

 
 

Repository files navigation

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:

  • Microsoft SqlServer 2012 and above
  • PostgreSQL

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)
✔️ ✔️ ✔️
  • 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)
✔️ ✔️
  • Can use interfaces to track changes
Dapper.Extensions Get
Insert
Update
Delete
GetList
GetPage/GetSet
Count
✔️
  • 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
✔️ ✔️ ✔️
  • Has a nice fluent syntax for complex WHERE operations
  • Can be configured without attributes
Dapper.SimpleCRUD Get
GetList
GetListPaged
Insert
Update
Delete(List)
RecordCount
✔️
  • 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.

About

CRUD Extensions for Dapper.Net

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 97.9%
  • TSQL 1.1%
  • PowerShell 1.0%