From: <kr_...@us...> - 2003-09-27 09:42:42
|
Update of /cvsroot/htoolkit/HSQL/PostgreSQL In directory sc8-pr-cvs1:/tmp/cvs-serv30391 Modified Files: HSQL.hsc Log Message: formatting Index: HSQL.hsc =================================================================== RCS file: /cvsroot/htoolkit/HSQL/PostgreSQL/HSQL.hsc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** HSQL.hsc 25 Sep 2003 17:20:01 -0000 1.7 --- HSQL.hsc 27 Sep 2003 09:42:28 -0000 1.8 *************** *** 14,40 **** module Database.PostgreSQL.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 Statement ! , query -- :: Connection -> String -> IO () ! , 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] , Point(..), Line(..), Path(..), Box(..), Circle(..), Polygon(..) , INetAddr(..), MacAddr(..) ) where - import Data.Dynamic import Data.IORef --- 14,39 ---- module Database.PostgreSQL.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 Statement ! , query -- :: Connection -> String -> IO () ! , 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] , Point(..), Line(..), Path(..), Box(..), Circle(..), Polygon(..) , INetAddr(..), MacAddr(..) ) where import Data.Dynamic import Data.IORef *************** *** 82,90 **** data Statement = Statement ! { pRes :: !PGresult , tupleIndex :: IORef Int ! , countTuples:: !Int ! , connection :: !Connection ! , fields :: ![FieldDef] } --- 81,89 ---- data Statement = Statement ! { pRes :: !PGresult , tupleIndex :: IORef Int ! , countTuples :: !Int ! , connection :: !Connection ! , fields :: ![FieldDef] } *************** *** 231,268 **** mkSqlType :: Oid -> Int -> SqlType ! mkSqlType (#const BPCHAROID) size = SqlChar (size-4) ! mkSqlType (#const VARCHAROID) size = SqlVarChar (size-4) ! mkSqlType (#const NAMEOID) size = SqlVarChar 31 ! mkSqlType (#const TEXTOID) size = SqlText ! mkSqlType (#const NUMERICOID) size = SqlNumeric ((size-4) `div` 0x10000) ((size-4) `mod` 0x10000) ! mkSqlType (#const INT2OID) size = SqlSmallInt ! mkSqlType (#const INT4OID) size = SqlInteger ! mkSqlType (#const FLOAT4OID) size = SqlReal ! mkSqlType (#const FLOAT8OID) size = SqlDouble ! mkSqlType (#const BOOLOID) size = SqlBool ! mkSqlType (#const BITOID) size = SqlBit size ! mkSqlType (#const VARBITOID) size = SqlVarBit size ! mkSqlType (#const BYTEAOID) size = SqlTinyInt ! mkSqlType (#const INT8OID) size = SqlBigInt ! mkSqlType (#const DATEOID) size = SqlDate ! mkSqlType (#const TIMEOID) size = SqlTime ! mkSqlType (#const TIMETZOID) size = SqlTimeTZ ! mkSqlType (#const ABSTIMEOID) size = SqlAbsTime ! mkSqlType (#const RELTIMEOID) size = SqlRelTime ! mkSqlType (#const INTERVALOID) size = SqlTimeInterval ! mkSqlType (#const TINTERVALOID) size = SqlAbsTimeInterval ! mkSqlType (#const TIMESTAMPOID) size = SqlTimeStamp ! mkSqlType (#const CASHOID) size = SqlMoney ! mkSqlType (#const INETOID) size = SqlINetAddr ! mkSqlType (#const 829) size = SqlMacAddr -- hack ! mkSqlType (#const CIDROID) size = SqlCIDRAddr ! mkSqlType (#const POINTOID) size = SqlPoint ! mkSqlType (#const LSEGOID) size = SqlLSeg ! mkSqlType (#const PATHOID) size = SqlPath ! mkSqlType (#const BOXOID) size = SqlBox ! mkSqlType (#const POLYGONOID) size = SqlPolygon ! mkSqlType (#const LINEOID) size = SqlLine ! mkSqlType (#const CIRCLEOID) size = SqlCircle ! mkSqlType (#const UNKNOWNOID) size = SqlUnknown -- | 'fetch' fetches the next rowset of data from the result set. --- 230,267 ---- mkSqlType :: Oid -> Int -> SqlType ! mkSqlType (#const BPCHAROID) size = SqlChar (size-4) ! mkSqlType (#const VARCHAROID) size = SqlVarChar (size-4) ! mkSqlType (#const NAMEOID) size = SqlVarChar 31 ! mkSqlType (#const TEXTOID) size = SqlText ! mkSqlType (#const NUMERICOID) size = SqlNumeric ((size-4) `div` 0x10000) ((size-4) `mod` 0x10000) ! mkSqlType (#const INT2OID) size = SqlSmallInt ! mkSqlType (#const INT4OID) size = SqlInteger ! mkSqlType (#const FLOAT4OID) size = SqlReal ! mkSqlType (#const FLOAT8OID) size = SqlDouble ! mkSqlType (#const BOOLOID) size = SqlBool ! mkSqlType (#const BITOID) size = SqlBit size ! mkSqlType (#const VARBITOID) size = SqlVarBit size ! mkSqlType (#const BYTEAOID) size = SqlTinyInt ! mkSqlType (#const INT8OID) size = SqlBigInt ! mkSqlType (#const DATEOID) size = SqlDate ! mkSqlType (#const TIMEOID) size = SqlTime ! mkSqlType (#const TIMETZOID) size = SqlTimeTZ ! mkSqlType (#const ABSTIMEOID) size = SqlAbsTime ! mkSqlType (#const RELTIMEOID) size = SqlRelTime ! mkSqlType (#const INTERVALOID) size = SqlTimeInterval ! mkSqlType (#const TINTERVALOID) size = SqlAbsTimeInterval ! mkSqlType (#const TIMESTAMPOID) size = SqlTimeStamp ! mkSqlType (#const CASHOID) size = SqlMoney ! mkSqlType (#const INETOID) size = SqlINetAddr ! mkSqlType (#const 829) size = SqlMacAddr -- hack ! mkSqlType (#const CIDROID) size = SqlCIDRAddr ! mkSqlType (#const POINTOID) size = SqlPoint ! mkSqlType (#const LSEGOID) size = SqlLSeg ! mkSqlType (#const PATHOID) size = SqlPath ! mkSqlType (#const BOXOID) size = SqlBox ! mkSqlType (#const POLYGONOID) size = SqlPolygon ! mkSqlType (#const LINEOID) size = SqlLine ! mkSqlType (#const CIRCLEOID) size = SqlCircle ! mkSqlType (#const UNKNOWNOID) size = SqlUnknown -- | 'fetch' fetches the next rowset of data from the result set. |