From: <kr_...@us...> - 2003-09-27 09:35:18
|
Update of /cvsroot/htoolkit/HSQL/ODBC In directory sc8-pr-cvs1:/tmp/cvs-serv29223 Modified Files: HSQL.hsc Log Message: formatting Index: HSQL.hsc =================================================================== RCS file: /cvsroot/htoolkit/HSQL/ODBC/HSQL.hsc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HSQL.hsc 25 Sep 2003 17:20:01 -0000 1.5 --- HSQL.hsc 27 Sep 2003 09:35:04 -0000 1.6 *************** *** 14,35 **** module Database.ODBC.HSQL ( SqlBind(..), SqlError(..), SqlType(..), Connection, Statement ! , catchSql -- :: IO a -> (SqlError -> IO a) -> IO a ! , handleSql -- :: (SqlError -> IO a) -> IO a -> IO a ! , sqlExceptions -- :: Exception -> Maybe SqlError ! , connect -- :: String -> String -> String -> IO Connection ! , disconnect -- :: Connection -> IO () ! , execute -- :: Connection -> String -> IO () ! , query -- :: Connection -> String -> IO Statement , closeStatement -- :: Statement -> IO () ! , fetch -- :: Statement -> IO Bool ! , inTransaction -- :: Connection -> (Connection -> IO a) -> IO a ! , getFieldValueMB -- :: SqlBind a => Statement -> String -> IO (Maybe a) ! , getFieldValue -- :: SqlBind a => Statement -> String -> IO a ! , getFieldValue' -- :: SqlBind a => Statement -> String -> a -> IO a ! , getFieldValueType -- :: Statement -> String -> (SqlType, Bool) ! , getFieldsTypes -- :: Statement -> [(String, SqlType, Bool)] ! , forEachRow -- :: (Statement -> s -> IO s) -> Statement -> s -> IO s ! , forEachRow' -- :: (Statement -> IO ()) -> Statement -> IO () ! , collectRows -- :: (Statement -> IO s) -> Statement -> IO [s] ) where --- 14,35 ---- module Database.ODBC.HSQL ( SqlBind(..), SqlError(..), SqlType(..), Connection, Statement ! , catchSql -- :: IO a -> (SqlError -> IO a) -> IO a ! , handleSql -- :: (SqlError -> IO a) -> IO a -> IO a ! , sqlExceptions -- :: Exception -> Maybe SqlError ! , connect -- :: String -> String -> String -> IO Connection ! , disconnect -- :: Connection -> IO () ! , execute -- :: Connection -> String -> IO () ! , query -- :: Connection -> String -> IO Statement , closeStatement -- :: Statement -> IO () ! , fetch -- :: Statement -> IO Bool ! , inTransaction -- :: Connection -> (Connection -> IO a) -> IO a ! , getFieldValueMB -- :: SqlBind a => Statement -> String -> IO (Maybe a) ! , getFieldValue -- :: SqlBind a => Statement -> String -> IO a ! , getFieldValue' -- :: SqlBind a => Statement -> String -> a -> IO a ! , getFieldValueType -- :: Statement -> String -> (SqlType, Bool) ! , getFieldsTypes -- :: Statement -> [(String, SqlType, Bool)] ! , forEachRow -- :: (Statement -> s -> IO s) -> Statement -> s -> IO s ! , forEachRow' -- :: (Statement -> IO ()) -> Statement -> IO () ! , collectRows -- :: (Statement -> IO s) -> Statement -> IO [s] ) where *************** *** 133,137 **** | SqlNeedData | SqlBadTypeCast ! { seFieldName :: String , seFieldType :: SqlType } --- 133,137 ---- | SqlNeedData | SqlBadTypeCast ! { seFieldName :: String , seFieldType :: SqlType } *************** *** 288,309 **** mkSqlType :: SQLSMALLINT -> SQLULEN -> SQLSMALLINT -> (SqlType, SQLINTEGER) ! mkSqlType (#const SQL_CHAR) size _ = (SqlChar (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1)) ! mkSqlType (#const SQL_VARCHAR) size _ = (SqlVarChar (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1)) ! mkSqlType (#const SQL_LONGVARCHAR) size _ = (SqlLongVarChar (fromIntegral size), 1) -- dummy bufSize ! mkSqlType (#const SQL_DECIMAL) size prec = (SqlDecimal (fromIntegral size) (fromIntegral prec), (#const sizeof(SQLDOUBLE))) ! mkSqlType (#const SQL_NUMERIC) size prec = (SqlNumeric (fromIntegral size) (fromIntegral prec), (#const sizeof(SQLDOUBLE))) ! mkSqlType (#const SQL_SMALLINT) _ _ = (SqlSmallInt, (#const sizeof(SQLSMALLINT))) ! mkSqlType (#const SQL_INTEGER) _ _ = (SqlInteger, (#const sizeof(SQLINTEGER))) ! mkSqlType (#const SQL_REAL) _ _ = (SqlReal, (#const sizeof(SQLDOUBLE))) ! mkSqlType (#const SQL_DOUBLE) _ _ = (SqlDouble, (#const sizeof(SQLDOUBLE))) ! mkSqlType (#const SQL_BIT) _ _ = (SqlBit, (#const sizeof(SQLINTEGER))) ! mkSqlType (#const SQL_TINYINT) _ _ = (SqlTinyInt, (#const sizeof(SQLSMALLINT))) ! mkSqlType (#const SQL_BIGINT) _ _ = (SqlBigInt, (#const sizeof(SQLINTEGER))) ! mkSqlType (#const SQL_BINARY) size _ = (SqlBinary (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1)) ! mkSqlType (#const SQL_VARBINARY) size _ = (SqlVarBinary (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1)) ! mkSqlType (#const SQL_LONGVARBINARY)size _ = (SqlLongVarBinary (fromIntegral size), 1) -- dummy bufSize ! mkSqlType (#const SQL_DATE) _ _ = (SqlDate, (#const sizeof(SQL_DATE_STRUCT))) ! mkSqlType (#const SQL_TIME) _ _ = (SqlTime, (#const sizeof(SQL_TIME_STRUCT))) ! mkSqlType (#const SQL_TIMESTAMP) _ _ = (SqlTimeStamp, (#const sizeof(SQL_TIMESTAMP_STRUCT))) --- 288,309 ---- mkSqlType :: SQLSMALLINT -> SQLULEN -> SQLSMALLINT -> (SqlType, SQLINTEGER) ! mkSqlType (#const SQL_CHAR) size _ = (SqlChar (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1)) ! mkSqlType (#const SQL_VARCHAR) size _ = (SqlVarChar (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1)) ! mkSqlType (#const SQL_LONGVARCHAR) size _ = (SqlLongVarChar (fromIntegral size), 1) -- dummy bufSize ! mkSqlType (#const SQL_DECIMAL) size prec = (SqlDecimal (fromIntegral size) (fromIntegral prec), (#const sizeof(SQLDOUBLE))) ! mkSqlType (#const SQL_NUMERIC) size prec = (SqlNumeric (fromIntegral size) (fromIntegral prec), (#const sizeof(SQLDOUBLE))) ! mkSqlType (#const SQL_SMALLINT) _ _ = (SqlSmallInt, (#const sizeof(SQLSMALLINT))) ! mkSqlType (#const SQL_INTEGER) _ _ = (SqlInteger, (#const sizeof(SQLINTEGER))) ! mkSqlType (#const SQL_REAL) _ _ = (SqlReal, (#const sizeof(SQLDOUBLE))) ! mkSqlType (#const SQL_DOUBLE) _ _ = (SqlDouble, (#const sizeof(SQLDOUBLE))) ! mkSqlType (#const SQL_BIT) _ _ = (SqlBit, (#const sizeof(SQLINTEGER))) ! mkSqlType (#const SQL_TINYINT) _ _ = (SqlTinyInt, (#const sizeof(SQLSMALLINT))) ! mkSqlType (#const SQL_BIGINT) _ _ = (SqlBigInt, (#const sizeof(SQLINTEGER))) ! mkSqlType (#const SQL_BINARY) size _ = (SqlBinary (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1)) ! mkSqlType (#const SQL_VARBINARY) size _ = (SqlVarBinary (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1)) ! mkSqlType (#const SQL_LONGVARBINARY)size _ = (SqlLongVarBinary (fromIntegral size), 1) -- dummy bufSize ! mkSqlType (#const SQL_DATE) _ _ = (SqlDate, (#const sizeof(SQL_DATE_STRUCT))) ! mkSqlType (#const SQL_TIME) _ _ = (SqlTime, (#const sizeof(SQL_TIME_STRUCT))) ! mkSqlType (#const SQL_TIMESTAMP) _ _ = (SqlTimeStamp, (#const sizeof(SQL_TIMESTAMP_STRUCT))) *************** *** 431,435 **** score = showChar '-' space = showChar ' ' ! colon = showChar ':' foreign import ccall unsafe mktime :: Ptr () -> IO CTime --- 431,435 ---- score = showChar '-' space = showChar ' ' ! colon = showChar ':' foreign import ccall unsafe mktime :: Ptr () -> IO CTime *************** *** 469,490 **** targetType = case sqlType of ! SqlBit -> (#const SQL_C_BIT) ! SqlTinyInt -> (#const SQL_C_UTINYINT) ! SqlSmallInt -> (#const SQL_C_SSHORT) ! SqlInteger -> (#const SQL_C_SLONG) ! SqlReal -> (#const SQL_C_FLOAT) ! SqlDouble -> (#const SQL_C_DOUBLE) ! SqlDate -> (#const SQL_C_TIMESTAMP) ! SqlTime -> (#const SQL_C_TIMESTAMP) ! SqlTimeStamp -> (#const SQL_C_TIMESTAMP) ! SqlNumeric _ _ -> (#const SQL_C_DOUBLE) ! SqlDecimal _ _ -> (#const SQL_C_DOUBLE) ! SqlBigInt -> (#const SQL_C_CHAR) ! SqlChar _ -> (#const SQL_C_CHAR) ! SqlVarChar _ -> (#const SQL_C_CHAR) ! SqlBinary _ -> (#const SQL_C_BINARY) ! SqlVarBinary _ -> (#const SQL_C_BINARY) ! SqlLongVarChar _ -> (#const SQL_C_CHAR) ! SqlLongVarBinary _ -> (#const SQL_C_BINARY) -- | Retrieves the value of field with the specified name. --- 469,490 ---- targetType = case sqlType of ! SqlBit -> (#const SQL_C_BIT) ! SqlTinyInt -> (#const SQL_C_UTINYINT) ! SqlSmallInt -> (#const SQL_C_SSHORT) ! SqlInteger -> (#const SQL_C_SLONG) ! SqlReal -> (#const SQL_C_FLOAT) ! SqlDouble -> (#const SQL_C_DOUBLE) ! SqlDate -> (#const SQL_C_TIMESTAMP) ! SqlTime -> (#const SQL_C_TIMESTAMP) ! SqlTimeStamp -> (#const SQL_C_TIMESTAMP) ! SqlNumeric _ _ -> (#const SQL_C_DOUBLE) ! SqlDecimal _ _ -> (#const SQL_C_DOUBLE) ! SqlBigInt -> (#const SQL_C_CHAR) ! SqlChar _ -> (#const SQL_C_CHAR) ! SqlVarChar _ -> (#const SQL_C_CHAR) ! SqlBinary _ -> (#const SQL_C_BINARY) ! SqlVarBinary _ -> (#const SQL_C_BINARY) ! SqlLongVarChar _ -> (#const SQL_C_CHAR) ! SqlLongVarBinary _ -> (#const SQL_C_BINARY) -- | Retrieves the value of field with the specified name. |