query1' :: (P.ToRow q, P.FromRow r) => DBState -> q -> P.Query -> IO (Maybe r)
query1' st qargs q =
    P.query (db' st) q qargs >>= \case
      []  -> return Nothing
      [r] -> return (Just r)
      _   -> error ("dbQuery1: query " ++ show q ++ " returned more than 1 row")
query1' :: (P.ToRow q, P.FromRow r) => DBState -> q -> P.Query -> IO (Maybe r)
query1' st qargs q =
    P.query (db' st) q qargs >>= \case
      []  -> return Nothing
      [r] -> return (Just r)
      _   -> error ("dbQuery1: query " ++ show q ++ " returned more than 1 row")
query1' st qargs q =
    P.query (db' st) q qargs >>= \case
      []  -> return Nothing
      [r] -> return (Just r)
      _   -> error ("dbQuery1: query " ++ show q ++ " returned more than 1 row")