Skip to content

Persistence interface for Haskell allowing multiple storage methods.

License

Notifications You must be signed in to change notification settings

meteficha/persistent

This branch is 1119 commits behind yesodweb/persistent:master.

Folders and files

NameName
Last commit message
Last commit date
Feb 26, 2015
Jun 9, 2015
Sep 4, 2015
Sep 16, 2015
May 12, 2015
Sep 6, 2015
Aug 31, 2015
Sep 14, 2015
Jul 27, 2015
Sep 2, 2015
Aug 28, 2015
Oct 29, 2014
Jun 14, 2015
Dec 10, 2014
Aug 28, 2015
Jul 13, 2015
Apr 27, 2012
Sep 8, 2015
May 15, 2015
Nov 26, 2014
Nov 26, 2014
Sep 2, 2015

Repository files navigation

Join the chat at https://gitter.im/yesodweb/persistent

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

see development.md

About

Persistence interface for Haskell allowing multiple storage methods.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 85.4%
  • Haskell 8.9%
  • C++ 5.7%