Update of /cvsroot/htoolkit/HSQL/HSQL/Database
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv21420/Database
Modified Files:
HSQL.hsc
Log Message:
added getStmtFieldValue to SqlBind type class
Index: HSQL.hsc
===================================================================
RCS file: /cvsroot/htoolkit/HSQL/HSQL/Database/HSQL.hsc,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** HSQL.hsc 25 Aug 2006 09:23:59 -0000 1.19
--- HSQL.hsc 20 Sep 2006 10:52:36 -0000 1.20
***************
*** 396,400 ****
(char '.' >> readDecP) `mplus` (return 0)
tz <- parseTZ
! return (mkClockTime 1970 1 1 hour minutes seconds (tz*3600))
fromSqlValue SqlTime s = f_read getTime s
--- 396,400 ----
(char '.' >> readDecP) `mplus` (return 0)
tz <- parseTZ
! return $! mkClockTime 1970 1 1 hour minutes seconds (tz*3600)
fromSqlValue SqlTime s = f_read getTime s
***************
*** 403,407 ****
getTime = do
(hour, minutes, seconds) <- readHMS
! return (mkClockTime 1970 1 1 hour minutes seconds 0)
fromSqlValue SqlDate s = f_read getDate s
--- 403,407 ----
getTime = do
(hour, minutes, seconds) <- readHMS
! return $! mkClockTime 1970 1 1 hour minutes seconds 0
fromSqlValue SqlDate s = f_read getDate s
***************
*** 410,414 ****
getDate = do
(year, month, day) <- readYMD
! return (mkClockTime year month day 0 0 0 0)
fromSqlValue SqlDateTimeTZ s = f_read getDateTimeTZ s
--- 410,414 ----
getDate = do
(year, month, day) <- readYMD
! return $! mkClockTime year month day 0 0 0 0
fromSqlValue SqlDateTimeTZ s = f_read getDateTimeTZ s
***************
*** 419,423 ****
char '.' >> readDecP -- ) `mplus` (return 0)
tz <- parseTZ
! return (mkClockTime year month day hour minutes seconds (tz*3600))
-- The only driver which seems to report the type as SqlTimeStamp seems
--- 419,423 ----
char '.' >> readDecP -- ) `mplus` (return 0)
tz <- parseTZ
! return $! mkClockTime year month day hour minutes seconds (tz*3600)
-- The only driver which seems to report the type as SqlTimeStamp seems
***************
*** 430,434 ****
getDateTime = do
(year, month, day, hour, minutes, seconds) <- readDateTime
! return (mkClockTime year month day hour minutes seconds 0)
fromSqlValue _ _ = Nothing
--- 430,434 ----
getDateTime = do
(year, month, day, hour, minutes, seconds) <- readDateTime
! return $! mkClockTime year month day hour minutes seconds 0
fromSqlValue _ _ = Nothing
***************
*** 604,609 ****
-> String -- ^ Field name
-> IO a -- ^ Field value
! getFieldValue stmt name =
! stmtGetCol stmt colNumber (name,sqlType,nullable) fromSqlCStringLen
where
(sqlType,nullable,colNumber) = findFieldInfo name (stmtFields stmt) 0
--- 604,608 ----
-> String -- ^ Field name
-> IO a -- ^ Field value
! getFieldValue stmt name = getStmtFieldValue stmt colNumber (name,sqlType,nullable)
where
(sqlType,nullable,colNumber) = findFieldInfo name (stmtFields stmt) 0
***************
*** 617,621 ****
getFieldValue' stmt name def = do
mb_v <- getFieldValue stmt name
! return (case mb_v of { Nothing -> def; Just a -> a })
-- | Retrieves the value of field with the specified index.
--- 616,620 ----
getFieldValue' stmt name def = do
mb_v <- getFieldValue stmt name
! return $! case mb_v of { Nothing -> def; Just a -> a }
-- | Retrieves the value of field with the specified index.
***************
*** 623,628 ****
-> Int -- ^ Field index
-> IO a -- ^ Field value
! getFieldValueAt stmt index =
! fieldDef `seq` stmtGetCol stmt index fieldDef fromSqlCStringLen
where
fieldDef = findColumnInfo (stmtFields stmt) index
--- 622,626 ----
-> Int -- ^ Field index
-> IO a -- ^ Field value
! getFieldValueAt stmt index = getStmtFieldValue stmt index $! fieldDef
where
fieldDef = findColumnInfo (stmtFields stmt) index
***************
*** 636,640 ****
getFieldValueAt' stmt index def = do
mb_v <- getFieldValueAt stmt index
! return (case mb_v of { Nothing -> def; Just a -> a })
{-# DEPRECATED getFieldValueMB "Use getFieldValue instead." #-}
--- 634,638 ----
getFieldValueAt' stmt index def = do
mb_v <- getFieldValueAt stmt index
! return $! case mb_v of { Nothing -> def; Just a -> a }
{-# DEPRECATED getFieldValueMB "Use getFieldValue instead." #-}
|