From: <kr_...@us...> - 2006-09-20 10:53:44
|
Update of /cvsroot/htoolkit/HSQL/HSQL/Database/HSQL In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv21863/Database/HSQL Modified Files: Types.hs Log Message: whitespace Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/HSQL/HSQL/Database/HSQL/Types.hs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Types.hs 20 Sep 2006 10:52:36 -0000 1.11 --- Types.hs 20 Sep 2006 10:53:40 -0000 1.12 *************** *** 148,170 **** class SqlBind a where ! -- This allows for faster conversion for eq. integral numeric types, etc. ! -- Default version uses fromSqlValue. ! fromSqlCStringLen :: FieldDef -> CString -> Int -> IO a ! fromSqlCStringLen = defaultFromSqlCStringLen ! getStmtFieldValue :: Statement -> Int -> FieldDef -> IO a ! getStmtFieldValue = defaultGetStmtFieldValue ! fromSqlValue :: SqlType -> String -> Maybe a ! toSqlValue :: a -> String defaultFromSqlCStringLen :: SqlBind a => FieldDef -> CString -> Int -> IO a defaultFromSqlCStringLen (name,sqlType,_) cstr cstrLen ! | cstr == nullPtr = throwDyn (SqlFetchNull name) ! | otherwise = do ! str <- peekCStringLen (cstr, cstrLen) ! case fromSqlValue sqlType str of ! Nothing -> throwDyn (SqlBadTypeCast name sqlType) ! Just v -> return v defaultGetStmtFieldValue :: SqlBind a => Statement -> Int -> FieldDef -> IO a --- 148,169 ---- class SqlBind a where ! -- This allows for faster conversion for eq. integral numeric types, etc. ! -- Default version uses fromSqlValue. ! fromSqlCStringLen :: FieldDef -> CString -> Int -> IO a ! fromSqlCStringLen = defaultFromSqlCStringLen ! getStmtFieldValue :: Statement -> Int -> FieldDef -> IO a ! getStmtFieldValue = defaultGetStmtFieldValue ! fromSqlValue :: SqlType -> String -> Maybe a ! toSqlValue :: a -> String defaultFromSqlCStringLen :: SqlBind a => FieldDef -> CString -> Int -> IO a defaultFromSqlCStringLen (name,sqlType,_) cstr cstrLen ! | cstr == nullPtr = throwDyn (SqlFetchNull name) ! | otherwise = do str <- peekCStringLen (cstr, cstrLen) ! case fromSqlValue sqlType str of ! Nothing -> throwDyn (SqlBadTypeCast name sqlType) ! Just v -> return v defaultGetStmtFieldValue :: SqlBind a => Statement -> Int -> FieldDef -> IO a |