addItem :: (IConnection c) => c -> RSSItem -> IO()
addItem conn it = do x <- quickQuery' conn "SELECT MAX(id) FROM rss_item" []
                     run conn "INSERT INTO rss_item (guid,title,author,url,feedurl,pubDate,content,unread,enclosure_url,enclosure_type) VALUES ('','','','','',0,'',1,'','')" []
                     updateItem conn $ setId it $ (pop x) + 1
    where pop :: [[SqlValue]] -> Integer
          pop x = fromSql $ head $ head x
          setId (RSSItem t u f d a g p eu et _ ur) id = RSSItem t u f d a g p eu et (Just id) ur
addItem :: (IConnection c) => c -> RSSItem -> IO()
addItem conn it = do x <- quickQuery' conn "SELECT MAX(id) FROM rss_item" []
                     run conn "INSERT INTO rss_item (guid,title,author,url,feedurl,pubDate,content,unread,enclosure_url,enclosure_type) VALUES ('','','','','',0,'',1,'','')" []
                     updateItem conn $ setId it $ (pop x) + 1
    where pop :: [[SqlValue]] -> Integer
          pop x = fromSql $ head $ head x
          setId (RSSItem t u f d a g p eu et _ ur) id = RSSItem t u f d a g p eu et (Just id) ur
addItem conn it = do x <- quickQuery' conn "SELECT MAX(id) FROM rss_item" []
                     run conn "INSERT INTO rss_item (guid,title,author,url,feedurl,pubDate,content,unread,enclosure_url,enclosure_type) VALUES ('','','','','',0,'',1,'','')" []
                     updateItem conn $ setId it $ (pop x) + 1
    where pop :: [[SqlValue]] -> Integer
          pop x = fromSql $ head $ head x
          setId (RSSItem t u f d a g p eu et _ ur) id = RSSItem t u f d a g p eu et (Just id) ur