ad Util module containing debug helpers

This commit is contained in:
nek0 2019-10-22 03:01:15 +02:00
parent f21e519057
commit f1c9d4282e

11
src/Util.hs Normal file
View file

@ -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