mateamt/src/Util.hs

12 lines
273 B
Haskell
Raw Normal View History

{-# LANGUAGE FlexibleContexts #-}
module Util where
import Opaleye
2019-12-12 02:15:56 +00:00
import Data.Maybe (fromMaybe)
import Data.Profunctor.Product.Default (Default)
printSql :: Default Unpackspec a a => Select a -> IO ()
2019-12-12 02:15:56 +00:00
printSql = putStrLn . fromMaybe "Empty query" . showSqlForPostgres