esqueleto 2.2.10 → 2.2.11
raw patch · 3 files changed
+16/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Database.Esqueleto.PostgreSQL: chr :: IsString s => SqlExpr (Value Int) -> SqlExpr (Value s)
Files
- esqueleto.cabal +1/−1
- src/Database/Esqueleto/PostgreSQL.hs +10/−0
- test/Test.hs +5/−1
esqueleto.cabal view
@@ -1,5 +1,5 @@ name: esqueleto-version: 2.2.10+version: 2.2.11 synopsis: Type-safe EDSL for SQL queries on persistent backends. homepage: https://github.com/prowdsponsor/esqueleto license: BSD3
src/Database/Esqueleto/PostgreSQL.hs view
@@ -6,6 +6,7 @@ module Database.Esqueleto.PostgreSQL ( arrayAgg , stringAgg+ , chr ) where import Data.String (IsString)@@ -32,3 +33,12 @@ -> SqlExpr (Value s) -- ^ Delimiter. -> SqlExpr (Value s) -- ^ Concatenation. stringAgg expr delim = unsafeSqlFunction "string_agg" (expr, delim)+++-- | (@chr@) Translate the given integer to a character. (Note the result will+-- depend on the character set of your database.)+--+-- /Since: 2.2.11/+chr :: IsString s+ => SqlExpr (Value Int) -> SqlExpr (Value s)+chr = unsafeSqlFunction "chr"
test/Test.hs view
@@ -1356,8 +1356,12 @@ from $ \p -> do return (EP.stringAgg (p ^. PersonName) (val " ")) liftIO $ L.sort (words ret) `shouldBe` L.sort (map personName people)-#endif + it "chr looks sane" $+ run $ do+ [Value (ret :: String)] <- select $ return (EP.chr (val 65))+ liftIO $ ret `shouldBe` "A"+#endif ----------------------------------------------------------------------