]> ruin.nu Git - yawbih.git/blobdiff - Wiki.hs
just a basic skeleton
[yawbih.git] / Wiki.hs
diff --git a/Wiki.hs b/Wiki.hs
index 916829e11a872db3fd7b99d37fb5e68954bf844e..c41effa9d481e63e5c7b41aa1aa5569504475287 100644 (file)
--- a/Wiki.hs
+++ b/Wiki.hs
@@ -1,21 +1,40 @@
 module Wiki (
+       WB
+       ,PGB
 
 ) where
 
-import Graphics.UI.WXCore.Db
+import Dbconnect
 
-{-Keyword -> Full text
-getCurrent :: String -> IO String
+class WB a where
+       --Keyword -> (Full text,date)
+       getCurrent :: a -> String -> IO (String,String)
 
---Keyword -> (id,date)
-getList :: String -> IO (Int, String)
+       --Keyword -> [(id,date)]
+       getList :: a -> String -> IO [(String, String)]
 
---Keyword -> id -> Full Text
-get :: String -> Int -> IO String
+       --Keyword -> id -> Full text
+       get :: a -> String -> String -> IO String
 
---Keyword -> id -> ()
-setCurrent :: String -> Int -> IO ()
+       --Keyword -> id -> ()
+       setCurrent :: a -> String -> String -> IO ()
 
---Keyword -> Full text -> id
-addNew :: String -> String -> IO Int
--}
+       --Keyword -> Full text -> id
+       addNew :: a -> String -> String -> IO String
+
+data PGB = PGB DBService
+
+createPGP host database user password = let db = createDBService host database "" user password Nothing in return (PGB db)
+
+
+instance WB PGB where
+
+       getCurrent (PGB db) key = return ("","")
+
+       getList (PGB db) key = return [("","")]
+
+       get (PGB db) key id = return ""
+
+       setCurrent (PGB db) key id = return ()
+
+       addNew (PGB db) key text = return ""