some clarification

This commit is contained in:
nek0 2022-07-24 16:49:41 +02:00
parent 7516b7912f
commit 8cf5edb0bb

View file

@ -19,6 +19,8 @@ import Opaleye as O
import Types
import Classes
-- | This function does (as opposed to all other init functions) create just the table,
-- but also creates a first settings object with default values.
initSettings :: PGS.Query
initSettings = mconcat
[ "CREATE TABLE IF NOT EXISTS \"settings\" ("
@ -42,8 +44,8 @@ settingsTable = table "settings" (
)
)
getSettings :: PGS.Connection -> MateHandler Settings
getSettings conn = liftIO $ do
selectSettings :: PGS.Connection -> MateHandler Settings
selectSettings conn = liftIO $ do
head . map fromDatabase <$> runSelect conn
( proc () -> do
ret <- limit 1 $ selectTable settingsTable -< ()