Commits

Luke Plant  committed e94a65b

Misc experimenting

  • Participants
  • Parent commits a463860

Comments (0)

Files changed (5)

+*.hi
 #!/bin/sh
-ghc -package cgi -package xhtml -fallow-overlapping-instances -static -optl-static --make -o blog.cgi blog.hs || exit 1
+ghc -package cgi -package xhtml -fallow-overlapping-instances --make -o blog.cgi blog.hs || exit 1
 chmod ugo+rwx blog.cgi
 mv blog.cgi /home/luke/httpd/lukeplant.me.uk/web/cgi-bin/blog.cgi
 import Database.HaskellDB
 import Database.HaskellDB.FieldType
 import Database.HaskellDB.DBSpec
-import Database.HaskellDB.HSQL.MySQL
 
-import qualified Settings
 
-test = DBInfo {dbname = "ctest", opts = testopts, tbls = [testtbl1,testtbl2]}
+opts = DBOptions {useBString = False}
 
-testopts = DBOptions {useBString = False}
+blogdb = DBInfo {dbname = "ctest", opts = testopts, tbls = [blogtable]}
 
-testtbl1 = TInfo {tname = "ctesttbl1", cols = [testcol11,testcol12]}
-testtbl2 = TInfo {tname = "ctesttbl2", cols = [testcol21,testcol22]}
+
+blogtable = TInfo {tname = "blog", cols = []}
+idcol = CInfo {cname = "id", descr = ()}
+
 
 testcol11 = CInfo {cname = "ctestcol11", descr = (IntT,False)}
 testcol12 = CInfo {cname = "ctestcol12", descr = (BStrT 8,True)}
 
 testcol21 = CInfo {cname = "ctestcol21", descr = (BStrT 6,False)}
 testcol22 = CInfo {cname = "ctestcol22", descr = (IntT,True)}
-
-main = do 
-       let db = mysqlConnect MySQLOptions { server = Settings.dbhost,
-                                            db = Settings.dbname,
-                                            uid = Settings.dbusername,
-                                            pwd = Settings.dbpassword }
-       db (\a -> dbSpecToDatabase a test)
-settingslocal.hs
+settingslive.hs

File settingslocal.hs

 dbname = "hdb_test_db"
 dbusername = "tester"
 dbpassword = "test"
+odbc_dsn="Driver={MySQL ODBC 3.51 Driver};Server=" ++ dbhost ++ 
+	";Database=" ++ dbname ++ 
+	"; User=" ++ dbusername ++ 
+	";Password=" ++ dbpassword ++ 
+	";Option=3;"
+
+sqlite_path="/home/luke/httpd/lukeplant.me.uk/web/cgi-bin/data/test1.db"