Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Persistence interface for Haskell allowing multiple storage methods.
C Haskell C++
Branch: master
Failed to load latest commit information.
experimental/couchDB Up dependency on the base package to >= 4.6 (removes GHC 7.4 support)
persistent-mongoDB Update http-api-data dependency, stop using .Internal
persistent-mysql Version bump (closes #488)
persistent-postgresql Bump persistent-postgresql to 2.2.1 (+ changelog entries).
persistent-redis Update http-api-data dependency, stop using .Internal
persistent-sqlite Warn not to use pool functions with :memory: $492
persistent-template Update http-api-data dependency, stop using .Internal
persistent-test Update http-api-data dependency, stop using .Internal
persistent-zookeeper Update http-api-data dependency, stop using .Internal
persistent Update http-api-data dependency, stop using .Internal
travis Travis: more matrix entries, smaller individual builds (fixes #460)
.dockerignore improve Docker build
.gitignore add stack.yaml
.gitmodules Remove scripts submodule
.travis.yml allow GHC 7.6 to fail
Dockerfile Dockerfile directions for stack
LICENSE Update license with MIT license Added Gitter badge docker instructions Add persistent-zookeeper for persistent-2.1.*
sources.txt Add persistent-zookeeper for persistent-2.1.*
stack.yaml Update http-api-data dependency, stop using .Internal

Learn more:

Join the chat at

Build Status

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, and ZooKeeper. 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

Install the Haskell Platform first. Clone this repo and run:

cabal update
cabal install cabal-meta cabal-src
cabal-meta install

Developing persistent


Something went wrong with that request. Please try again.