Thanks! At first sight they look compatible with what I've been finding out. But I suspect that haskelldb-th with it's CodeGen module is history. I just got that bit working like this:
{-# LANGUAGE TemplateHaskell #-}
import Database.HaskellDB
import Database.HaskellDB.DBSpec
import Database.HaskellDB.DBSpec.PPHelpers
import Database.HaskellDB.HDBC
import Database.HaskellDB.HDBC.PostgreSQL
import Database.HaskellDB.DBSpec.DBSpecToDBDirect
-- These work after the dbInfoToModuleFiles run ...
--import Adsdb
--import Adsdb.Test
adsDB :: (Database -> IO a) -> IO a
adsDB = postgresqlConnect adsdb_opts
adsdb_opts = [("host","localhost")
,("user","ad")
,("password","1wd1wd")
,("dbname","adsdb")]
dbinfo :: DBInfo
dbinfo = makeDBSpec "Adsdb"
(DBOptions { useBString = False , makeIdent = mkIdentPreserving })
[ makeTInfo "Test"
[ makeCInfo "teststring" (StringT, False)
, makeCInfo "testint" (IntT, False)
]
]
main = dbInfoToModuleFiles "." "Adsdb" dbinfo
but when I import the generated code it warns like this:
Adsdb.hs:12:24:
Warning: Fields of `DBOptions' not initialised: makeIdent
In the `opts' field of a record
In the expression:
DBInfo
{dbname = "Adsdb", opts = DBOptions {useBString = False},
tbls = [TInfo
{tname = "Test",
cols = [CInfo {cname = "teststring", descr = ...}, ....]}]}
In an equation for `adsdb':
adsdb
= DBInfo
{dbname = "Adsdb", opts = DBOptions {useBString = False},
tbls = [TInfo {tname = "Test", cols = [...]}]}
Adrian.