From c2c7bbe9dd1e2908160827d7f90cacc589c33264 Mon Sep 17 00:00:00 2001 From: Remo Rechkemmer <59358383+monacoremo@users.noreply.github.com> Date: Mon, 12 Apr 2021 20:47:22 +0200 Subject: [PATCH] refactor: remove obsoleted Private module (#1811) --- src/PostgREST/Private/Common.hs | 38 --------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 src/PostgREST/Private/Common.hs diff --git a/src/PostgREST/Private/Common.hs b/src/PostgREST/Private/Common.hs deleted file mode 100644 index 12b9d445c6..0000000000 --- a/src/PostgREST/Private/Common.hs +++ /dev/null @@ -1,38 +0,0 @@ -{-| -Module : PostgREST.Common -Description : Common helper functions. --} -module PostgREST.Private.Common where - -import Data.Maybe -import qualified Hasql.Decoders as HD -import qualified Hasql.DynamicStatements.Snippet as H -import qualified Hasql.Encoders as HE -import Protolude - -import Data.Foldable (foldr1) - -column :: HD.Value a -> HD.Row a -column = HD.column . HD.nonNullable - -compositeField :: HD.Value a -> HD.Composite a -compositeField = HD.field . HD.nonNullable - -nullableColumn :: HD.Value a -> HD.Row (Maybe a) -nullableColumn = HD.column . HD.nullable - -arrayColumn :: HD.Value a -> HD.Row [a] -arrayColumn = column . HD.listArray . HD.nonNullable - -compositeArrayColumn :: HD.Composite a -> HD.Row [a] -compositeArrayColumn = arrayColumn . HD.composite - -param :: HE.Value a -> HE.Params a -param = HE.param . HE.nonNullable - -arrayParam :: HE.Value a -> HE.Params [a] -arrayParam = param . HE.foldableArray . HE.nonNullable - -intercalateSnippet :: ByteString -> [H.Snippet] -> H.Snippet -intercalateSnippet _ [] = mempty -intercalateSnippet frag snippets = foldr1 (\a b -> a <> H.sql frag <> b) snippets