persistent-mysql-haskell 0.4.1 → 0.4.2
raw patch · 3 files changed
+5/−13 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +3/−0
- Database/Persist/MySQL.hs +1/−12
- persistent-mysql-haskell.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,6 @@+## 0.4.2+- [#7](https://github.com/naushadh/persistent/pull/7) Fix boolean conversion bug.+ ## 0.4.1 - Fix [#2](https://github.com/naushadh/persistent/issues/2): Better compatibility with `yesod` scaffold.
Database/Persist/MySQL.hs view
@@ -251,11 +251,6 @@ encodeBool True = MySQL.MySQLInt8U 1 encodeBool False = MySQL.MySQLInt8U 0 --- | Decode a Numeric value into a PersistBool-decodeBool :: (Eq a, Num a) => a -> PersistValue-decodeBool 0 = PersistBool False-decodeBool _ = PersistBool True- -- | Decode a whole number into a PersistInt64 decodeInteger :: Integral a => a -> PersistValue decodeInteger = PersistInt64 . fromIntegral@@ -294,14 +289,8 @@ -- | Get the corresponding @'Getter' 'PersistValue'@ depending on -- the type of the column. getGetter :: MySQL.ColumnDef -> Getter PersistValue-getGetter field = case (MySQL.columnLength field) of- 1 -> goBool- _ -> go+getGetter _field = go where- -- Bool- goBool (MySQL.MySQLInt8U v) = decodeBool v- goBool (MySQL.MySQLInt8 v) = decodeBool v- goBool _ = PersistBool False -- Int64 go (MySQL.MySQLInt8U v) = decodeInteger v go (MySQL.MySQLInt8 v) = decodeInteger v
persistent-mysql-haskell.cabal view
@@ -1,5 +1,5 @@ name: persistent-mysql-haskell-version: 0.4.1+version: 0.4.2 license: MIT license-file: LICENSE author: Naushadh <naushadh@protonmail.com>, Felipe Lessa <felipe.lessa@gmail.com>, Michael Snoyman