From: <kr_...@us...> - 2006-01-04 21:00:44
|
Update of /cvsroot/htoolkit/HSQL/HSQL/Database/HSQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10357/Database/HSQL Modified Files: Types.hs Log Message: possible framework for prepared statements Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/HSQL/HSQL/Database/HSQL/Types.hs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Types.hs 3 Jan 2006 22:59:46 -0000 1.4 --- Types.hs 4 Jan 2006 21:00:09 -0000 1.5 *************** *** 7,10 **** --- 7,11 ---- import Foreign import Foreign.C + import System.Time type FieldDef = (String, SqlType, Bool) *************** *** 117,120 **** --- 118,122 ---- { connDisconnect :: IO () , connExecute :: String -> IO Integer + , connPrepare :: String -> IO Statement , connQuery :: String -> IO Statement , connTables :: IO [String] *************** *** 129,140 **** data Statement = Statement ! { stmtConn :: Connection ! , stmtClose :: IO () ! , stmtFetch :: IO Bool ! , stmtGetCol :: forall a . Int -> FieldDef -> (FieldDef -> CString -> Int -> IO a) -> IO a ! , stmtFields :: [FieldDef] ! , stmtClosed :: MVar Bool } class SqlBind a where --- 131,150 ---- data Statement = Statement ! { stmtConn :: Connection ! , stmtClose :: IO () ! , stmtSetParam :: SqlValue -> IO () ! , stmtExecute :: IO () ! , stmtFetch :: IO Bool ! , stmtGetCol :: forall a . Int -> FieldDef -> (FieldDef -> CString -> Int -> IO a) -> IO a ! , stmtFields :: [FieldDef] ! , stmtClosed :: MVar Bool } + data SqlValue = SqlStringValue String + | SqlIntValue Int + | SqlDoubleValue Double + | SqlBoolValue Bool + | SqlClockTimeValue ClockTime + | SqlNullValue class SqlBind a where |