Add FromSQLValue Boolean instance

This commit is contained in:
rightfold 2017-04-04 13:33:19 +02:00
parent 0566be6dee
commit a68279e6c4
No known key found for this signature in database
GPG Key ID: 199D0373AC917A8F

View File

@ -28,7 +28,7 @@ import Data.Array (head)
import Data.ByteString (ByteString)
import Data.DateTime.Instant (Instant)
import Data.Either (Either(..))
import Data.Foreign (Foreign, isNull, readArray, readChar, readInt, readString, toForeign, unsafeFromForeign)
import Data.Foreign (Foreign, isNull, readArray, readBoolean, readChar, readInt, readString, toForeign, unsafeFromForeign)
import Data.Foreign.Null (writeNull)
import Data.List (List)
import Data.List as List
@ -112,6 +112,9 @@ instance fromSQLRowTuple5 :: (FromSQLValue a, FromSQLValue b, FromSQLValue c, Fr
instance toSQLValueBoolean :: ToSQLValue Boolean where
toSQLValue = toForeign
instance fromSQLValueBoolean :: FromSQLValue Boolean where
fromSQLValue = fromRight <<< runExcept <<< readBoolean
instance toSQLValueChar :: ToSQLValue Char where
toSQLValue = toForeign