https://github.com/dmjio/persistent-generic
Generic facilities for working with Persistent classes
https://github.com/dmjio/persistent-generic
database generics ghc ghc-generics haskell persistent
Last synced: about 1 month ago
JSON representation
Generic facilities for working with Persistent classes
- Host: GitHub
- URL: https://github.com/dmjio/persistent-generic
- Owner: dmjio
- License: bsd-3-clause
- Created: 2020-04-02T13:45:06.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-14T00:53:59.000Z (over 1 year ago)
- Last Synced: 2025-09-25T15:43:10.476Z (6 months ago)
- Topics: database, generics, ghc, ghc-generics, haskell, persistent
- Language: Haskell
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
persistent-generic
==========================
Generic facilities for working with `Persistent` classes.
```haskell
{-# language DeriveGeneric #-}
module Main where
import Database.Persist.Generic
data StopLight = Red | Yellow | Green
deriving (Show, Eq, Generic)
instance PersistField StopLight where
toPersistValue = genericToPersistValue
fromPersistValue = genericFromPersistValue
```
### Limitations
- Only `PersistField` is currently supported.