seakale-postgresql 0.2.0.0 → 0.2.0.1
raw patch · 3 files changed
+14/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
ChangeLog.md view
@@ -1,12 +1,16 @@ # Revision history for seakale-postgresql +## 0.2.0.1 -- 2017-03-20++* Fix ToRow instance of lists.+ ## 0.2.0.0 -- 2017-02-23 -* Compatible version with seakale-0.2.0.0+* 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+* PSQL now takes a Bool to specify whether to log the queries to stderr. ## 0.1.0.0 -- 2017-01-31
seakale-postgresql.cabal view
@@ -1,5 +1,5 @@ name: seakale-postgresql-version: 0.2.0.0+version: 0.2.0.1 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.2.0.0+ tag: seakale-postgresql-0.2.0.1 library ghc-options: -Wall
src/Database/Seakale/PostgreSQL/ToRow.hs view
@@ -30,7 +30,7 @@ instance {-# OVERLAPPABLE #-} ToRow PSQL One a => ToRow PSQL One [a] where toRow backend = singleton . Just . ("'{" <>) . (<> "}'") . mconcat . intersperse ","- . map (("\"" <>) . (<> "\"") . escapeByteString)+ . map (("\"" <>) . (<> "\"") . escapeByteString . trimOuterQuotes) . (>>= map (fromMaybe "NULL") . vectorToList . toRow backend) escapeByteString :: BS.ByteString -> BS.ByteString@@ -39,3 +39,8 @@ (bs', ("\\", bs'')) -> bs' <> "\\\\" <> escapeByteString bs'' (bs', ("\"", bs'')) -> bs' <> "\\\"" <> escapeByteString bs'' (bs', _) -> bs'++trimOuterQuotes :: BS.ByteString -> BS.ByteString+trimOuterQuotes bs =+ let bs' = case BS.splitAt 1 bs of { ("'", b) -> b; _ -> bs }+ in case BS.unsnoc bs' of { Just (bs'', '\'') -> bs''; _ -> bs' }