Petapoco

Official PetaPoco, A tiny ORM-ish thing for your POCO's
Alternatives To Petapoco
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Apijson15,902
5 days ago224otherJava
🏆 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构。 🏆 A JSON Transmission Protocol and an ORM Library 🚀 provides APIs and Docs without writing any code.
Drizzle Orm13,6033513 hours ago407July 27, 2023484apache-2.0TypeScript
TypeScript ORM that feels like writing SQL.
Sqlc9,131162 days ago140July 31, 2023248mitGo
Generate type-safe code from SQL
Sqlalchemy7,79741,8535,33915 hours ago289July 15, 2023185mitPython
The Database Toolkit for Python
Exposed7,484219 hours ago17July 28, 2023256apache-2.0Kotlin
Kotlin SQL Framework
Objection.js7,087707405a day ago202July 22, 202379mitJavaScript
An SQL-friendly ORM for Node.js
Records6,956150276 months ago11September 02, 201764iscPython
SQL for Humans™
Mikro Orm6,50915711 hours ago2,010August 07, 202373mitTypeScript
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite databases.
Sqlboiler6,0291242 days ago98March 21, 202389bsd-3-clauseGo
Generate a Go ORM tailored to your database schema.
Jooq5,6501,17531710 hours ago204June 23, 20231,926otherJava
jOOQ is the best way to write SQL in Java
Alternatives To Petapoco
Select To Compare


Alternative Project Comparisons
Readme
PetaPoco Logo

Welcome to the official PetaPoco repository

Originally the brainchild of Brad Robinson.

PetaPoco is maintained and extended by Wade Baglin (@pleb) and Aaron Sherber (@asherber).

Version 6 - Netstandard 2.0+, 4.0, 4.5+

Read more about the v6 update

PetaPoco is available from: NuGet PetaPoco.Compiled

Master Development Nuget
Build status Build status Nuget Downloads

Documentation

For configuration documentation, code examples, and other general usage information, see the docs.

Add-ons

Version 5 - Legacy

Nuget (Single file) Nuget Core (+t4 templates) Nuget Core Compiled (dll)
Nuget Downloads Nuget Downloads core Nuget Downloads core

PetaPoco is a tiny & fast micro-ORM for .NET

  • Like Dapper, it's fast because it uses dynamic method generation (MSIL) to assign column values to properties
  • Like Massive, it now also supports dynamic Expandos too
  • Like ActiveRecord, it supports a close relationship between object and database table
  • Like SubSonic, it supports generation of poco classes with T4 templates (V5 only)
  • Like Massive, it's available as a single file that you easily add to any project or complied. (V5 only)

Features at a Glance

  • Tiny, and absolutely no dependencies!
  • Asychronous (aka async) or synchronous: the choice is yours. (V6)
  • Works with strictly undecorated POCOs, or attributed almost-POCOs.
  • Easy to configure, including fluent configuration out of the box.
  • Helper methods for Insert/Delete/Update/Save and IsNew
  • Paged requests automatically work out the total record count and fetch a specific page.
  • Easy transaction support.
  • Better parameter replacement support, including grabbing named parameters from object properties.
  • Great performance by eliminating Linq and fast property assignment with DynamicMethod generation.
  • The query language is good'ole SQL.
  • Includes a low friction SQL builder class that makes writing inline SQL much easier.
  • Includes T4 templates to automatically generate POCO classes for you. (V5)
  • Hooks for logging exceptions, installing value converters and mapping columns to properties without attributes.
  • Works with SQL Server, SQL Server CE, MS Access, SQLite, MySQL, MariaDB, Firebird, and PostgreSQL. (Oracle is supported but does not have integration tests).
  • Works under Net Standard 2.0, .NET 4.0/4.5+ or Mono 2.8 and later.
  • Has Xunit unit tests.
  • Has supported DBs integration tests.
  • OpenSource (MIT License or Apache 2.0)

Super easy use and configuration

Save an entity

db.Save(article);
db.Save(new Article { Title = "Super easy to use PetaPoco" });
db.Save("Articles", "Id", { Title = "Super easy to use PetaPoco", Id = Guid.New() });

Get an entity

var article = db.Single<Article>(123);
var article = db.Single<Article>("WHERE ArticleKey = @0", "ART-123");

Delete an entity

db.Delete(article);
db.Delete<Article>(123);
db.Delete("Articles", "Id", 123);
db.Delete("Articles", "ArticleKey", "ART-123");

Plus much, much more.

Contributing

PetaPoco welcomes input from the community. After all, what is a product without users? If you would like to contribute, please take the time to read the contribution guide. We would also suggest you have a quick read of Contributing to Open Source on GitHub.

Contributions Honour Roll

PetaPoco is not the result of just one person's labour, but rather, the product of a combined effort by many. For those individuals who go above and beyond, we have a special place to honour them.

Popular Sql Projects
Popular Orm Projects
Popular Data Processing Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
C Sharp
Sql
Orm
Linq