module Wiki (
+ WB
+ ,PGB
) where
-class WikiBackend a where
- --Keyword -> Full text
- getCurrent :: a -> String -> IO String
+import Dbconnect
+
+class WB a where
+ --Keyword -> (Full text,date)
+ getCurrent :: a -> String -> IO (String,String)
--Keyword -> [(id,date)]
- getList :: a -> String -> IO [(Int, String)]
+ getList :: a -> String -> IO [(String, String)]
--Keyword -> id -> Full text
- get :: a -> String -> Int -> IO String
+ get :: a -> String -> String -> IO String
--Keyword -> id -> ()
- setCurrent :: a -> String -> Int -> IO ()
+ setCurrent :: a -> String -> String -> IO ()
--Keyword -> Full text -> id
- addNew :: String -> String -> IO Int
+ 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 ""