From 8cf5edb0bbd6f4cbc4ae7059115729ff797b38f4 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 24 Jul 2022 16:49:41 +0200 Subject: [PATCH] some clarification --- src/Model/Settings.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Model/Settings.hs b/src/Model/Settings.hs index d704a65..648b7e4 100644 --- a/src/Model/Settings.hs +++ b/src/Model/Settings.hs @@ -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 -< ()