2013-03-25 12:26:23 +04:00
|
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
|
|
|
|
2013-03-29 16:19:50 +04:00
|
|
|
module PgTest where
|
2013-03-25 12:26:23 +04:00
|
|
|
|
|
|
|
import Distribution.TestSuite (Test)
|
|
|
|
import PgTestDataSource (defineTable)
|
2013-03-27 12:49:10 +04:00
|
|
|
-- import Database.HDBC.PostgreSQL (connectPostgreSQL, Connection)
|
|
|
|
-- import Database.HDBC.Schema.PostgreSQL (driverPostgreSQL)
|
|
|
|
-- import Database.HDBC.Schema.Driver (typeMap)
|
|
|
|
-- import Database.HDBC.TH (defineTableFromDB)
|
|
|
|
import Data.ByteString (ByteString)
|
|
|
|
import Data.Text (Text)
|
2013-03-25 12:26:23 +04:00
|
|
|
|
|
|
|
tests :: [Test]
|
|
|
|
tests = []
|
|
|
|
|
2013-03-27 12:49:10 +04:00
|
|
|
$(defineTable
|
|
|
|
[("varchar", [t| ByteString |]),
|
|
|
|
("text", [t| Text |])
|
|
|
|
]
|
|
|
|
"TEST" "test_table0" [])
|
|
|
|
-- defineTableFromDB
|
|
|
|
-- (connectPostgreSQL "dbname=testdb")
|
|
|
|
-- (driverPostgreSQL { typeMap = [("varchar", [t| Text |])] })
|
|
|
|
-- "TEST" "test_table0" []
|