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 ""