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