generated from tpl/purs
Add FromSQLValue Number
This commit is contained in:
parent
8e09f99502
commit
e58c71e26c
@ -28,7 +28,7 @@ import Data.Array (head, uncons)
|
|||||||
import Data.ByteString (ByteString)
|
import Data.ByteString (ByteString)
|
||||||
import Data.DateTime.Instant (Instant)
|
import Data.DateTime.Instant (Instant)
|
||||||
import Data.Either (Either(..))
|
import Data.Either (Either(..))
|
||||||
import Data.Foreign (Foreign, isNull, readArray, readBoolean, readChar, readInt, readString, toForeign, unsafeFromForeign)
|
import Data.Foreign (Foreign, isNull, readArray, readBoolean, readChar, readInt, readNumber, readString, toForeign, unsafeFromForeign)
|
||||||
import Data.Foreign.Null (writeNull)
|
import Data.Foreign.Null (writeNull)
|
||||||
import Data.List (List)
|
import Data.List (List)
|
||||||
import Data.List as List
|
import Data.List as List
|
||||||
@ -114,6 +114,9 @@ instance fromSQLValueInt :: FromSQLValue Int where
|
|||||||
instance toSQLValueNumber :: ToSQLValue Number where
|
instance toSQLValueNumber :: ToSQLValue Number where
|
||||||
toSQLValue = toForeign
|
toSQLValue = toForeign
|
||||||
|
|
||||||
|
instance fromSQLValueNumber :: FromSQLValue Number where
|
||||||
|
fromSQLValue = fromRight <<< runExcept <<< readNumber
|
||||||
|
|
||||||
instance toSQLValueString :: ToSQLValue String where
|
instance toSQLValueString :: ToSQLValue String where
|
||||||
toSQLValue = toForeign
|
toSQLValue = toForeign
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user