diff --git a/src/Database/PostgreSQL.purs b/src/Database/PostgreSQL.purs index 46bf510..8a36cc5 100644 --- a/src/Database/PostgreSQL.purs +++ b/src/Database/PostgreSQL.purs @@ -23,7 +23,7 @@ import Control.Monad.Aff (Aff) import Control.Monad.Error.Class (catchError, throwError) import Control.Monad.Except (runExcept) import Data.Either (Either(..)) -import Data.Foreign (Foreign, readArray, readString, toForeign) +import Data.Foreign (Foreign, readArray, readChar, readString, toForeign) import Data.List (List) import Data.List as List import Data.Maybe (fromJust, Maybe(..)) @@ -108,6 +108,12 @@ instance fromSQLRowTuple5 :: (FromSQLValue a, FromSQLValue b, FromSQLValue c, Fr fromSQLRow [a, b, c, d, e] = tuple5 <$> fromSQLValue a <*> fromSQLValue b <*> fromSQLValue c <*> fromSQLValue d <*> fromSQLValue e fromSQLRow _ = Nothing +instance toSQLValueChar :: ToSQLValue Char where + toSQLValue = toForeign + +instance fromSQLValueChar :: FromSQLValue Char where + fromSQLValue = fromRight <<< runExcept <<< readChar + instance toSQLValueString :: ToSQLValue String where toSQLValue = toForeign