aboutsummaryrefslogtreecommitdiff
path: root/src/DB.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DB.hs')
-rw-r--r--src/DB.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/DB.hs b/src/DB.hs
index 8f3bbdb..77b097d 100644
--- a/src/DB.hs
+++ b/src/DB.hs
@@ -9,11 +9,10 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module DB where
+import Protolude
import Database.Persist.Sqlite
import Database.Persist.TH
import Data.Time.Clock ( UTCTime )
-import Data.Text as T
-import Control.Monad.IO.Class ( MonadIO )
import Control.Monad.Trans.Resource ( MonadBaseControl )
import Control.Monad.Logger ( MonadLogger )
import Types hiding ( Feed (..) )
@@ -25,7 +24,7 @@ openConnectionCount = 10
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
Feed
- ident T.Text
+ ident Text
updated UTCTime
UniqueFeed ident
deriving Show
@@ -33,7 +32,7 @@ Feed
runDB :: (MonadIO m, MonadBaseControl IO m, Control.Monad.Logger.MonadLogger m) => Database -> SqlPersistT m a -> m a
runDB database query = do
- pool <- createSqlitePool (T.pack $ toFilePath database) openConnectionCount
+ pool <- createSqlitePool (toS $ toFilePath database) openConnectionCount
runSqlPool query pool
init :: (MonadIO m, MonadBaseControl IO m, MonadLogger m) => Database -> m ()