haskell-relational-record/doc/slide/Haskell-Day-201609/DataSource.hs
2016-09-14 19:32:21 +09:00

12 lines
422 B
Haskell

module DataSource (definePgConTable) where
import Language.Haskell.TH
-- import Language.Haskell.TH.Name.CamelCase (ConName)
import Database.HDBC.PostgreSQL (connectPostgreSQL)
import Database.HDBC.Query.TH
import Database.HDBC.Schema.PostgreSQL (driverPostgreSQL)
definePgConTable :: String -> String -> [Name] -> Q [Dec]
definePgConTable =
defineTableFromDB (connectPostgreSQL "dbname=haskell-day") driverPostgreSQL