git.iko.soy/typeable/postgresql-simple
on master help sign in
Add FromField instance for ()
0551b67Leon P Smith
src/Database/PostgreSQL/Simple/FromField.hs+6
@@ -228,6 +228,12 @@ tableColumn Field{..} = fromCol (unsafeDupablePerformIO (PQ.ftablecol result col
228format :: Field -> PQ.Format
228format :: Field -> PQ.Format
229format Field{..} = unsafeDupablePerformIO (PQ.fformat result column)
229format Field{..} = unsafeDupablePerformIO (PQ.fformat result column)
230
230
231+-- | void
232+instance FromField () where
233+ fromField f _bs
234+ | typeOid f /= $(inlineTypoid TI.void) = returnError Incompatible f ""
235+ | otherwise = pure ()
236+
231-- | For dealing with null values. Compatible with any postgresql type
237-- | For dealing with null values. Compatible with any postgresql type
232-- compatible with type @a@. Note that the type is not checked if
238-- compatible with type @a@. Note that the type is not checked if
233-- the value is null, although it is inadvisable to rely on this
239-- the value is null, although it is inadvisable to rely on this