My patches to the Haskell persistent library

fr33domlover 8788807048 Atomic insertUnique in SqlBackend and PostgreSQL 9.5+ support %!s(int64=5) %!d(string=hai) anos
.github c3135c5881 Add Github templates and files to help with reproducing issues %!s(int64=7) %!d(string=hai) anos
bin e8dbafb099 Tidying up a few things %!s(int64=5) %!d(string=hai) anos
docs 3259636539 Sum type docs %!s(int64=5) %!d(string=hai) anos
experimental ecf0a52786 Up dependency on the base package to >= 4.6 (removes GHC 7.4 support) %!s(int64=9) %!d(string=hai) anos
persistent 8788807048 Atomic insertUnique in SqlBackend and PostgreSQL 9.5+ support %!s(int64=5) %!d(string=hai) anos
persistent-mongoDB 700086e36d Releases %!s(int64=5) %!d(string=hai) anos
persistent-mysql 8788807048 Atomic insertUnique in SqlBackend and PostgreSQL 9.5+ support %!s(int64=5) %!d(string=hai) anos
persistent-postgresql 8788807048 Atomic insertUnique in SqlBackend and PostgreSQL 9.5+ support %!s(int64=5) %!d(string=hai) anos
persistent-qq 1e356ad119 Matt/build with cabal (#900) %!s(int64=5) %!d(string=hai) anos
persistent-redis a3eed2f7c5 Cleanup of pragmas, imports and dependencies (#888) %!s(int64=5) %!d(string=hai) anos
persistent-sqlite 8788807048 Atomic insertUnique in SqlBackend and PostgreSQL 9.5+ support %!s(int64=5) %!d(string=hai) anos
persistent-template 10ff69c7b9 mkEntityDefList (#904) %!s(int64=5) %!d(string=hai) anos
persistent-test 3e88b423b0 bump persistent-test version (#905) %!s(int64=5) %!d(string=hai) anos
persistent-zookeeper 3591de2525 Merge branch 'http-api-data-release' %!s(int64=8) %!d(string=hai) anos
travis 1e356ad119 Matt/build with cabal (#900) %!s(int64=5) %!d(string=hai) anos
.dockerignore ed25be45d3 improve Docker build %!s(int64=10) %!d(string=hai) anos
.gitattributes 4c582f1d99 Fix language stat(s) for persistent repo. (#663) %!s(int64=7) %!d(string=hai) anos
.gitignore e8dbafb099 Tidying up a few things %!s(int64=5) %!d(string=hai) anos
.gitmodules d99d6855de Remove scripts submodule %!s(int64=10) %!d(string=hai) anos
.travis.yml 10ff69c7b9 mkEntityDefList (#904) %!s(int64=5) %!d(string=hai) anos
CONTRIBUTING.md e8dbafb099 Tidying up a few things %!s(int64=5) %!d(string=hai) anos
LICENSE 62e3056a5d Update license with MIT license %!s(int64=12) %!d(string=hai) anos
README.md e8dbafb099 Tidying up a few things %!s(int64=5) %!d(string=hai) anos
cabal.project 1e356ad119 Matt/build with cabal (#900) %!s(int64=5) %!d(string=hai) anos
development.md e8dbafb099 Tidying up a few things %!s(int64=5) %!d(string=hai) anos
docker-compose.yml 2093ccb94b add testing setup for postgres %!s(int64=7) %!d(string=hai) anos
justfile b7eaba651d a better docker-based testing approach %!s(int64=7) %!d(string=hai) anos
sources.txt 722929f636 Add persistent-zookeeper for persistent-2.1.* %!s(int64=10) %!d(string=hai) anos
stack-docker.yaml 7c12ad4e9d Create separate persistent-qq (fixes #827) %!s(int64=6) %!d(string=hai) anos
stack.yaml 0d87a7c434 [CI] Add newer resolvers, update tested ones (#873) %!s(int64=5) %!d(string=hai) anos
stack_lts-10.yaml a3eed2f7c5 Cleanup of pragmas, imports and dependencies (#888) %!s(int64=5) %!d(string=hai) anos
stack_lts-12.yaml 28d4c2c987 JSON "question mark" operators for persistent-postgresql (#884) %!s(int64=5) %!d(string=hai) anos

README.md

Learn more: http://www.yesodweb.com/book/persistent

Build Status Hackage Hackage-Deps

A Haskell datastore. Datastores are often referred to as "ORM"s. While 'O' traditionally means object, the concept can be generalized as:

avoidance of boilerplate serialization

In addition , the ORM concept is a way to make what is usually an un-typed driver type-safe. In dynamic languages rather than compile time errors, safety comes from creating specific dynamic errors rather than sending nonsense queries to the database.

Persistent's goal is to catch every possible error at compile-time, and it comes close to that.

Backend agnostic

Supports PostgreSql, Sqlite, MongoDB, Redis, ZooKeeper, and many other databases via persistent-odbc. The MySQL backend is in need of a maintainer. Currently there are issues with migrations and support for composite and primary keys is lacking.

Persistent is designed to be adaptable to any datastore, and to allow multiple datastores to be used simultaneously. The serialization layer should be adaptable to any datastore.

Providing a universal query layer will always be limiting. A major limitation for SQL databases is that the persistent library does not directly provide joins. However, you can use Esqueleto with Persistent's serialization to write type-safe SQL queries. Key-value stores such as Redis can be used with persistent, but only fill out the key-value portion of the API (PersistStore) rather than the query portion (PersistQuery).

Persistent provides several hooks to create backend-specific functionality. One can always fall back to using the raw database driver or other lower-level or less type-safe libraries and can utilize Persistent for un-serializing the database response to a Haskell record.

Install from source

Clone the repo and run stack build to build all targets. Persistent supports many backends. If you have only some of these installed the development doc shows how to build against a subset of targets.