From ab35c3fcc01e43f9aea657f4c1c35bd66de0aafb Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Sun, 5 Dec 2004 15:26:35 +0000 Subject: [PATCH] just a basic skeleton --- Wiki.hs | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/Wiki.hs b/Wiki.hs index c4b7166..c41effa 100644 --- a/Wiki.hs +++ b/Wiki.hs @@ -1,20 +1,40 @@ 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 "" -- 2.39.2