My patches to the Haskell persistent library
fr33domlover 8788807048 Atomic insertUnique in SqlBackend and PostgreSQL 9.5+ support | 5 年 前 | |
---|---|---|
.github | 7 年 前 | |
bin | 5 年 前 | |
docs | 5 年 前 | |
experimental | 9 年 前 | |
persistent | 5 年 前 | |
persistent-mongoDB | 5 年 前 | |
persistent-mysql | 5 年 前 | |
persistent-postgresql | 5 年 前 | |
persistent-qq | 5 年 前 | |
persistent-redis | 5 年 前 | |
persistent-sqlite | 5 年 前 | |
persistent-template | 5 年 前 | |
persistent-test | 5 年 前 | |
persistent-zookeeper | 8 年 前 | |
travis | 5 年 前 | |
.dockerignore | 10 年 前 | |
.gitattributes | 7 年 前 | |
.gitignore | 5 年 前 | |
.gitmodules | 10 年 前 | |
.travis.yml | 5 年 前 | |
CONTRIBUTING.md | 5 年 前 | |
LICENSE | 12 年 前 | |
README.md | 5 年 前 | |
cabal.project | 5 年 前 | |
development.md | 5 年 前 | |
docker-compose.yml | 7 年 前 | |
justfile | 7 年 前 | |
sources.txt | 10 年 前 | |
stack-docker.yaml | 6 年 前 | |
stack.yaml | 5 年 前 | |
stack_lts-10.yaml | 5 年 前 | |
stack_lts-12.yaml | 5 年 前 |
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.