packages feed

odbc 0.0.3 → 0.0.4

raw patch · 3 files changed

+7/−24 lines, 3 files

Files

odbc.cabal view
@@ -5,7 +5,7 @@              suite runs on OS X, Windows and Linux. copyright: FP Complete 2018 maintainer: chrisdone@fpcomplete.com-version:             0.0.3+version:             0.0.4 license:             BSD3 license-file:        LICENSE build-type:          Simple
src/Database/ODBC/Internal.hs view
@@ -639,7 +639,7 @@ -- | Get the column's data as a vector of CHAR. getBytesData :: Ptr EnvAndDbc -> SQLHSTMT s -> SQLUSMALLINT -> IO (Maybe Value) getBytesData dbc stmt column = do-  mavailableBytes <- getSize dbc stmt sql_c_char column+  mavailableBytes <- getSize dbc stmt sql_c_binary column   case mavailableBytes of     Just 0 -> pure (Just (ByteStringValue mempty))     Just availableBytes -> do@@ -649,7 +649,7 @@         (getTypedData            dbc            stmt-           sql_c_char+           sql_c_binary            column            (coerce bufferp)            (SQLLEN (fromIntegral allocBytes)))@@ -1074,8 +1074,8 @@ sql_c_wchar :: SQLCTYPE sql_c_wchar = coerce sql_wchar -sql_c_char :: SQLCTYPE-sql_c_char = coerce sql_char+-- sql_c_char :: SQLCTYPE+-- sql_c_char = coerce sql_char  sql_c_binary :: SQLCTYPE sql_c_binary = coerce sql_binary
test/Main.hs view
@@ -12,7 +12,7 @@  -- | Test suite. -module Main where+module Main (main) where  import           Control.Exception (try, onException, SomeException, catch, throwIO) import           Control.Monad@@ -229,13 +229,6 @@        TextValue b -> pure b        _ -> Nothing)   quickCheckInternalRoundtrip-    "ByteString"-    "text"-    showBytes-    (\case-       ByteStringValue b -> pure b-       _ -> Nothing)-  quickCheckInternalRoundtrip     "Text"     ("nvarchar(" <> T.pack (show maxStringLen) <> ")")     showText@@ -243,13 +236,6 @@        TextValue b -> pure b        _ -> Nothing)   quickCheckInternalRoundtrip-    "ByteString"-    ("varchar(" <> T.pack (show maxStringLen) <> ")")-    showBytes-    (\case-       ByteStringValue b -> pure b-       _ -> Nothing)-  quickCheckInternalRoundtrip     "Bool"     "bit"     (\case@@ -446,9 +432,6 @@ -------------------------------------------------------------------------------- -- Helpers -showBytes :: ByteString -> Text-showBytes t = "'" <> T.pack (S8.unpack t) <> "'"- showText :: Text -> Text showText t = "N'" <> t <> "'" @@ -492,7 +475,7 @@ instance Arbitrary ByteString where   arbitrary =     fmap-      (S8.filter (\c -> isAscii c && validTextChar c) .+      (S8.filter (\c -> validTextChar c) .        S8.pack . take maxStringLen)       arbitrary