]> ruin.nu Git - yawbih.git/blob - Wiki.hs
c41effa9d481e63e5c7b41aa1aa5569504475287
[yawbih.git] / Wiki.hs
1 module Wiki (
2         WB
3         ,PGB
4
5 ) where
6
7 import Dbconnect
8
9 class WB a where
10         --Keyword -> (Full text,date)
11         getCurrent :: a -> String -> IO (String,String)
12
13         --Keyword -> [(id,date)]
14         getList :: a -> String -> IO [(String, String)]
15
16         --Keyword -> id -> Full text
17         get :: a -> String -> String -> IO String
18
19         --Keyword -> id -> ()
20         setCurrent :: a -> String -> String -> IO ()
21
22         --Keyword -> Full text -> id
23         addNew :: a -> String -> String -> IO String
24
25 data PGB = PGB DBService
26
27 createPGP host database user password = let db = createDBService host database "" user password Nothing in return (PGB db)
28
29
30 instance WB PGB where
31
32         getCurrent (PGB db) key = return ("","")
33
34         getList (PGB db) key = return [("","")]
35
36         get (PGB db) key id = return ""
37
38         setCurrent (PGB db) key id = return ()
39
40         addNew (PGB db) key text = return ""