-
Notifications
You must be signed in to change notification settings - Fork 1
/
Persistent-GP.tex
55 lines (43 loc) · 2.13 KB
/
Persistent-GP.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
% Persistent-GP.tex
\begin{hcarentry}{Persistent}
\label{persistent}
\report{Greg Weber}%11/14
\participants{Michael Snoyman, Felipe Lessa}
\status{stable}
\makeheader
The last HCAR announcement was for the release of Persistent 2.0, featuring a flexible primary key type.
Since then, persistent has mostly experienced bug fixes, including recent fixes and increased backend support for the new flexible primary key type.
Haskell has many different database bindings available, but most provide few
usefeul static guarantees. Persistent uses knowledge of the data schema to
provide a type-safe interface to the database. Persistent is designed to work
across different databases, currently working on Sqlite, PostgreSQL, MongoDB,
MySQL, Redis, and ZooKeeper.
Persistent provides a high-level query interface that works against all
backends.
\begin{code}
selectList [ PersonFirstName ==. "Simon",
PersonLastName ==. "Jones"] []
\end{code}
The result of this will be a list of Haskell records.
Persistent can also be used to write type-safe query libraries that are
specific. esqueleto is a library for writing arbitrary SQL queries that is
built on Persistent.
\FuturePlans
Persistent is in a stable, feature complete state. Future plans are only to increase its ease the places where it can be easitly used:
\begin{compactitem}
\item Declaring a schema separately from a record, possibly leveraging GHC's
new annotations feature or another pattern
\end{compactitem}
Persistent users may also be interested in Groundhog \cref{groundhog}, a
similar project.
Persistent is recommended to Yesod~\cref{yesod} users. However, there is
nothing particular to Yesod or even web development about it. You can have a
type-safe, productive way to store data for any kind of Haskell project.
\FurtherReading
\begin{compactitem}
\item \url{http://www.yesodweb.com/book/persistent}
\item \url{http://hackage.haskell.org/package/esqueleto}
\item \url{http://www.yesodweb.com/blog/2014/09/persistent-2}
\item \url{http://www.yesodweb.com/blog/2014/08/announcing-persistent-2}
\end{compactitem}
\end{hcarentry}