From 84b04aae042d2b39a30ffe4839b857c8ba1da1f7 Mon Sep 17 00:00:00 2001 From: John Ky Date: Tue, 15 Oct 2024 21:11:37 +1100 Subject: [PATCH 1/2] Remove unnecessary semicolons --- polysemy/Data/RdsData/Polysemy/Core.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polysemy/Data/RdsData/Polysemy/Core.hs b/polysemy/Data/RdsData/Polysemy/Core.hs index c3f83c8..d6dff0c 100644 --- a/polysemy/Data/RdsData/Polysemy/Core.hs +++ b/polysemy/Data/RdsData/Polysemy/Core.hs @@ -109,11 +109,11 @@ initialiseDb = withFrozenCallStack do , " deployed_by TEXT NOT NULL," , " CONSTRAINT valid_ulid_constraint" , " CHECK (ulid::text ~ '^[0-9A-HJKMNP-TV-Z]{26}$')" - , ");" + , ")" ] executeStatement_ - "CREATE INDEX IF NOT EXISTS idx_migration_created_at ON migration (created_at);" + "CREATE INDEX IF NOT EXISTS idx_migration_created_at ON migration (created_at)" executeStatement_ - "CREATE INDEX IF NOT EXISTS idx_migration_deployed_by ON migration (deployed_by);" + "CREATE INDEX IF NOT EXISTS idx_migration_deployed_by ON migration (deployed_by)" From f82dfb957baa58b409c43129f55ac61790b2068a Mon Sep 17 00:00:00 2001 From: John Ky Date: Fri, 18 Oct 2024 22:03:13 +1100 Subject: [PATCH 2/2] New fail function --- src/Data/RdsData/Decode/Value.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Data/RdsData/Decode/Value.hs b/src/Data/RdsData/Decode/Value.hs index ea868b6..61dbd37 100644 --- a/src/Data/RdsData/Decode/Value.hs +++ b/src/Data/RdsData/Decode/Value.hs @@ -41,6 +41,8 @@ module Data.RdsData.Decode.Value , uuid , day + , fail + ) where import Amazonka.Data.Base64 @@ -54,7 +56,7 @@ import Data.Text (Text) import Data.Time import Data.UUID (UUID) import Data.Word -import Prelude hiding (maybe, null) +import Prelude hiding (fail, maybe, null) import qualified Amazonka.Data.ByteString as AWS import qualified Data.Aeson as J @@ -87,6 +89,10 @@ instance Monad DecodeValue where a' <- a v decodeValue (f a') v +fail :: Text -> DecodeValue a +fail = + DecodeValue . const . Left + -------------------------------------------------------------------------------- rdsValue :: DecodeValue Value