seakale-postgresql 0.1.1.0 → 0.2.0.0
raw patch · 3 files changed
+12/−7 lines, 3 filesdep ~seakalePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: seakale
API changes (from Hackage documentation)
- Database.Seakale.PostgreSQL: type QueryData (n :: Nat) = Vector n ByteString
+ Database.Seakale.PostgreSQL: type QueryData (n :: Nat) = Vector n (Maybe ByteString)
Files
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for seakale-postgresql +## 0.2.0.0 -- 2017-02-23++* Compatible version with seakale-0.2.0.0+ ## 0.1.1.0 -- 2017-02-17 * PSQL now takes a Bool to specify whether to log the queries to stderr
seakale-postgresql.cabal view
@@ -1,5 +1,5 @@ name: seakale-postgresql-version: 0.1.1.0+version: 0.2.0.0 synopsis: PostgreSQL backend for Seakale description: This package provides a way to run code written with Seakale with a PostgreSQL database. license: BSD3@@ -14,7 +14,7 @@ source-repository head type: darcs location: http://darcs.redspline.com/seakale- tag: seakale-postgresql-0.1.1.0+ tag: seakale-postgresql-0.2.0.0 library ghc-options: -Wall@@ -37,7 +37,7 @@ Database.Seakale.PostgreSQL.ToRow build-depends: base >=4.8 && <4.10- , seakale ==0.1.*+ , seakale ==0.2.* , postgresql-libpq , bytestring , mtl
src/Database/Seakale/PostgreSQL/ToRow.hs view
@@ -6,6 +6,7 @@ ) where import Data.List+import Data.Maybe import Data.Monoid import Data.Time import qualified Data.ByteString.Char8 as BS@@ -17,8 +18,8 @@ instance ToRow PSQL One Bool where toRow _ = \case- True -> Cons "'t'" Nil- False -> Cons "'f'" Nil+ True -> Cons (Just "'t'") Nil+ False -> Cons (Just "'f'") Nil instance ToRow PSQL One UTCTime where toRow backend = toRow backend . formatTime defaultTimeLocale "%F %T%QZ"@@ -28,9 +29,9 @@ instance {-# OVERLAPPABLE #-} ToRow PSQL One a => ToRow PSQL One [a] where toRow backend =- singleton . ("'{" <>) . (<> "}'") . mconcat . intersperse ","+ singleton . Just . ("'{" <>) . (<> "}'") . mconcat . intersperse "," . map (("\"" <>) . (<> "\"") . escapeByteString)- . (>>= vectorToList . toRow backend)+ . (>>= map (fromMaybe "NULL") . vectorToList . toRow backend) escapeByteString :: BS.ByteString -> BS.ByteString escapeByteString bs =