Allow queries to return ().

This commit is contained in:
Felipe Lessa 2012-09-05 20:34:03 -03:00
parent c41a7dd464
commit b67fcedfeb

View File

@ -480,6 +480,10 @@ class SqlSelect a r | a -> r, r -> a where
-- | Transform a row of the result into the data type.
sqlSelectProcessRow :: [PersistValue] -> Either T.Text r
instance SqlSelect () () where
sqlSelectCols _ _ = mempty
sqlSelectColCount _ = 0
sqlSelectProcessRow _ = Right ()
instance PersistEntity a => SqlSelect (SqlExpr (Entity a)) (Entity a) where
sqlSelectCols escape expr@(EEntity ident) = ret