mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-12 12:09:08 +03:00
12 lines
422 B
Haskell
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
|