From 0776708892493eefa8fc27424e85ea80cabf769b Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 27 Sep 2022 22:46:59 +0530 Subject: Return monadic value from MonadicDictCursor.fetchone. * wqflask/utility/monads.py (MonadicDictCursor.fetchone): Return monadic value. --- wqflask/utility/monads.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/utility/monads.py b/wqflask/utility/monads.py index 26225eaa..80ba42c8 100644 --- a/wqflask/utility/monads.py +++ b/wqflask/utility/monads.py @@ -124,7 +124,7 @@ class MonadicDictCursor(DictCursor): ... print(row) """ def fetchone(self): - return MonadicDict(super().fetchone()) + return Just(MonadicDict(row)) if (row := super().fetchone()) else Nothing def fetchmany(self, size=None): return [MonadicDict(row) for row in super().fetchmany(size=size)] def fetchall(self): -- cgit v1.2.3