ad Util module containing debug helpers
This commit is contained in:
parent
f21e519057
commit
f1c9d4282e
1 changed files with 11 additions and 0 deletions
11
src/Util.hs
Normal file
11
src/Util.hs
Normal 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
|
Loading…
Reference in a new issue