git.iko.soy/typeable/postgresql-simple
on master help sign in
Add FromField instance for ()
commit0551b679072888cd3606a8362bd33da74448f3a6 authorLeon P Smith <leon@melding-monads.com> dateWed 11 Sep 2013, 16:29 (13 years ago) parentba0cd23
1 file changed+6
src/Database/PostgreSQL/Simple/FromField.hs+6
src/Database/PostgreSQL/Simple/FromField.hs+6
@@ -228,6 +228,12 @@ tableColumn Field{..} = fromCol (unsafeDupablePerformIO (PQ.ftablecol result col
228228format :: Field -> PQ.Format
229229format Field{..} = unsafeDupablePerformIO (PQ.fformat result column)
230230
231+-- | void
232+instance FromField () where
233+ fromField f _bs
234+ | typeOid f /= $(inlineTypoid TI.void) = returnError Incompatible f ""
235+ | otherwise = pure ()
236+
231237-- | For dealing with null values. Compatible with any postgresql type
232238-- compatible with type @a@. Note that the type is not checked if
233239-- the value is null, although it is inadvisable to rely on this