Skip to content

Commit e24e445

Browse files
committed
Add SqlValue instance for Date
1 parent e388cd9 commit e24e445

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Database/Postgres/SqlValue.purs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Database.Postgres.SqlValue
77
import Prelude ((<<<))
88
import Data.Int (toNumber)
99
import Data.Maybe (Maybe(..))
10+
import Data.Date as Date
1011

1112
foreign import data SqlValue :: *
1213

@@ -26,6 +27,9 @@ instance isSqlValueMaybe :: (IsSqlValue a) => IsSqlValue (Maybe a) where
2627
toSql Nothing = nullSqlValue
2728
toSql (Just x) = toSql x
2829

30+
instance isSqlValueDate :: IsSqlValue Date.Date where
31+
toSql = unsafeToSqlValue
32+
2933
foreign import unsafeToSqlValue :: forall a. a -> SqlValue
3034

3135
foreign import nullSqlValue :: SqlValue

0 commit comments

Comments
 (0)