My patches to the Haskell persistent library
Matt Parsons 3e88b423b0 bump persistent-test version (#905) | %!s(int64=5) %!d(string=hai) anos | |
---|---|---|
.github | %!s(int64=7) %!d(string=hai) anos | |
bin | %!s(int64=5) %!d(string=hai) anos | |
docs | %!s(int64=5) %!d(string=hai) anos | |
experimental | %!s(int64=9) %!d(string=hai) anos | |
persistent | %!s(int64=5) %!d(string=hai) anos | |
persistent-mongoDB | %!s(int64=5) %!d(string=hai) anos | |
persistent-mysql | %!s(int64=5) %!d(string=hai) anos | |
persistent-postgresql | %!s(int64=5) %!d(string=hai) anos | |
persistent-qq | %!s(int64=5) %!d(string=hai) anos | |
persistent-redis | %!s(int64=5) %!d(string=hai) anos | |
persistent-sqlite | %!s(int64=5) %!d(string=hai) anos | |
persistent-template | %!s(int64=5) %!d(string=hai) anos | |
persistent-test | %!s(int64=5) %!d(string=hai) anos | |
persistent-zookeeper | %!s(int64=8) %!d(string=hai) anos | |
travis | %!s(int64=5) %!d(string=hai) anos | |
.dockerignore | %!s(int64=10) %!d(string=hai) anos | |
.gitattributes | %!s(int64=7) %!d(string=hai) anos | |
.gitignore | %!s(int64=5) %!d(string=hai) anos | |
.gitmodules | %!s(int64=10) %!d(string=hai) anos | |
.travis.yml | %!s(int64=5) %!d(string=hai) anos | |
CONTRIBUTING.md | %!s(int64=5) %!d(string=hai) anos | |
LICENSE | %!s(int64=12) %!d(string=hai) anos | |
README.md | %!s(int64=5) %!d(string=hai) anos | |
cabal.project | %!s(int64=5) %!d(string=hai) anos | |
development.md | %!s(int64=5) %!d(string=hai) anos | |
docker-compose.yml | %!s(int64=7) %!d(string=hai) anos | |
justfile | %!s(int64=7) %!d(string=hai) anos | |
sources.txt | %!s(int64=10) %!d(string=hai) anos | |
stack-docker.yaml | %!s(int64=6) %!d(string=hai) anos | |
stack.yaml | %!s(int64=5) %!d(string=hai) anos | |
stack_lts-10.yaml | %!s(int64=5) %!d(string=hai) anos | |
stack_lts-12.yaml | %!s(int64=5) %!d(string=hai) anos |
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.
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.
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.