packages feed

mysql-simple 0.2.1.2 → 0.2.2.0

raw patch · 4 files changed

+22/−4 lines, 4 filesdep +base16-bytestring

Dependencies added: base16-bytestring

Files

Database/MySQL/Simple.hs view
@@ -48,6 +48,7 @@     , Connection     , Query     , In(..)+    , Binary(..)     , Only(..)     -- ** Exceptions     , FormatError(fmtMessage, fmtQuery, fmtParams)@@ -96,7 +97,7 @@ import Database.MySQL.Simple.QueryParams (QueryParams(..)) import Database.MySQL.Simple.QueryResults (QueryResults(..)) import Database.MySQL.Simple.Result (ResultError(..))-import Database.MySQL.Simple.Types (In(..), Only(..), Query(..))+import Database.MySQL.Simple.Types (Binary(..), In(..), Only(..), Query(..)) import Text.Regex.PCRE.Light (compile, caseless, match) import qualified Data.ByteString.Char8 as B import qualified Database.MySQL.Base as Base
Database/MySQL/Simple/Param.hs view
@@ -18,10 +18,13 @@     , inQuotes     ) where -import Blaze.ByteString.Builder (Builder, fromByteString, toByteString)+import Blaze.ByteString.Builder (Builder, fromByteString, fromLazyByteString,+                                 toByteString) import Blaze.ByteString.Builder.Char8 (fromChar) import Blaze.Text (integral, double, float) import Data.ByteString (ByteString)+import qualified Data.ByteString.Base16 as B16+import qualified Data.ByteString.Base16.Lazy as L16 import Data.Int (Int8, Int16, Int32, Int64) import Data.List (intersperse) import Data.Monoid (mappend)@@ -31,7 +34,7 @@ import Data.Time.LocalTime (TimeOfDay) import Data.Typeable (Typeable) import Data.Word (Word, Word8, Word16, Word32, Word64)-import Database.MySQL.Simple.Types (In(..), Null)+import Database.MySQL.Simple.Types (Binary(..), In(..), Null) import System.Locale (defaultTimeLocale) import qualified Blaze.ByteString.Builder.Char.Utf8 as Utf8 import qualified Data.ByteString as SB@@ -80,6 +83,14 @@         Plain (fromChar '(') :         (intersperse (Plain (fromChar ',')) . map render $ xs) ++         [Plain (fromChar ')')]++instance Param (Binary SB.ByteString) where+    render (Binary bs) = Plain $ fromByteString "0x" `mappend`+                                 fromByteString (B16.encode bs)++instance Param (Binary LB.ByteString) where+    render (Binary bs) = Plain $ fromByteString "0x" `mappend`+                                 fromLazyByteString (L16.encode bs)  renderNull :: Action renderNull = Plain (fromByteString "null")
Database/MySQL/Simple/Types.hs view
@@ -15,6 +15,7 @@       Null(..)     , Only(..)     , In(..)+    , Binary(..)     , Query(..)     ) where @@ -97,4 +98,8 @@ -- -- > query c "select * from whatever where id in ?" (In [3,4,5]) newtype In a = In a+    deriving (Eq, Ord, Read, Show, Typeable, Functor)++-- | Wrap a mostly-binary string to be escaped in hexadecimal.+newtype Binary a = Binary a     deriving (Eq, Ord, Read, Show, Typeable, Functor)
mysql-simple.cabal view
@@ -1,5 +1,5 @@ name:           mysql-simple-version:        0.2.1.2+version:        0.2.2.0 homepage:       https://github.com/mailrank/mysql-simple bug-reports:    https://github.com/mailrank/mysql-simple/issues synopsis:       A mid-level MySQL client library.@@ -41,6 +41,7 @@   build-depends:     attoparsec >= 0.8.5.3,     base < 5,+    base16-bytestring,     blaze-builder,     blaze-textual,     bytestring >= 0.9,