From b7aa7ec45d64505ff9eb043560f7b3b61b18435c Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Sat, 6 Feb 2016 13:36:35 +0000 Subject: [PATCH] Make it build with persistent --- src/Vervis/Persist.hs | 45 +++++++++++++++++++++++++++++++++++++++++++ vervis.cabal | 4 ++++ 2 files changed, 49 insertions(+) create mode 100644 src/Vervis/Persist.hs diff --git a/src/Vervis/Persist.hs b/src/Vervis/Persist.hs new file mode 100644 index 0000000..add78ea --- /dev/null +++ b/src/Vervis/Persist.hs @@ -0,0 +1,45 @@ +{- This file is part of Vervis. + - + - Written in 2016 by fr33domlover . + - + - ♡ Copying is an act of love. Please copy, reuse and share. + - + - The author(s) have dedicated all copyright and related and neighboring + - rights to this software to the public domain worldwide. This software is + - distributed without any warranty. + - + - You should have received a copy of the CC0 Public Domain Dedication along + - with this software. If not, see + - . + -} + +{-# LANGUAGE EmptyDataDecls #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE QuasiQuotes #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeFamilies #-} + +module Vervis.Persist + --( + --) +where + +import Control.Monad.IO.Class (liftIO) +import Database.Persist +import Database.Persist.Sqlite +import Database.Persist.TH + +share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| +Person + name String + age Int Maybe + deriving Show +BlogPost + title String + authorId PersonId + deriving Show +|] diff --git a/vervis.cabal b/vervis.cabal index e5b516f..6d1c575 100644 --- a/vervis.cabal +++ b/vervis.cabal @@ -30,6 +30,7 @@ library , Vervis.Git , Vervis.Monad , Vervis.Ops + , Vervis.Persist , Vervis.Types -- other-modules: -- other-extensions: @@ -42,6 +43,9 @@ library , json-state , hashable , hourglass + , persistent + , persistent-sqlite + , persistent-template , text >=1 , time-units , transformers >=0.4.2