Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support for UTCTime values in query parameters #1

Merged
merged 1 commit into from

2 participants

@gzh

With the code already written, UTCTime support is added just for free.

@bos bos merged commit 674e30d into bos:master
@bos
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 30, 2011
  1. @gzh
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 5 deletions.
  1. +6 −5 Database/HDBC/MySQL/Connection.hsc
View
11 Database/HDBC/MySQL/Connection.hsc
@@ -419,8 +419,12 @@ bindOfSqlValue (Types.SqlWord64 n) = do
buf_ <- new n
bindOfSqlValue' (8::Int) buf_ #{const MYSQL_TYPE_LONGLONG} Unsigned
-bindOfSqlValue (Types.SqlEpochTime epoch) = do
- let t = utcToMysqlTime $ posixSecondsToUTCTime (fromIntegral epoch)
+bindOfSqlValue (Types.SqlEpochTime epoch) =
+ bindOfSqlValue (Types.SqlUTCTime t)
+ where t = posixSecondsToUTCTime (fromIntegral epoch)
+
+bindOfSqlValue (Types.SqlUTCTime utct) = do
+ let t = utcToMysqlTime utct
buf_ <- new t
bindOfSqlValue' (#{const sizeof(MYSQL_TIME)}::Int) buf_ #{const MYSQL_TYPE_DATETIME} Signed
where utcToMysqlTime :: UTCTime -> MYSQL_TIME
@@ -455,9 +459,6 @@ bindOfSqlValue (Types.SqlLocalTime _) =
bindOfSqlValue (Types.SqlZonedTime _) =
error "SqlZonedTime: bind type not implemented"
-bindOfSqlValue (Types.SqlUTCTime _) =
- error "SqlUTCTime: bind type not implemented"
-
bindOfSqlValue (Types.SqlDiffTime _) =
error "SqlDiffTime: bind type not implemented"
Something went wrong with that request. Please try again.