Commits

Luke Plant committed e94a65b

Misc experimenting

Comments (0)

Files changed (5)

 #!/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
 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"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.