From f1c9d4282e14a8f6385c3e3bcc0ec7f192f3b03b Mon Sep 17 00:00:00 2001 From: nek0 Date: Tue, 22 Oct 2019 03:01:15 +0200 Subject: [PATCH] ad Util module containing debug helpers --- src/Util.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/Util.hs diff --git a/src/Util.hs b/src/Util.hs new file mode 100644 index 0000000..21e6434 --- /dev/null +++ b/src/Util.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE FlexibleContexts #-} +module Util where + +import Opaleye + +import Data.Maybe (maybe) + +import Data.Profunctor.Product.Default (Default) + +printSql :: Default Unpackspec a a => Select a -> IO () +printSql = putStrLn . maybe "Empty query" id . showSqlForPostgres