aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/monads.py
diff options
context:
space:
mode:
authorArun Isaac2022-09-27 22:46:59 +0530
committerArun Isaac2022-09-29 16:15:47 +0530
commit0776708892493eefa8fc27424e85ea80cabf769b (patch)
treedb3873428d9a4cedde003d124d80573548bfbb31 /wqflask/utility/monads.py
parentf5442998edbbdcad423b570c69521a4813e74854 (diff)
downloadgenenetwork2-0776708892493eefa8fc27424e85ea80cabf769b.tar.gz
Return monadic value from MonadicDictCursor.fetchone.
* wqflask/utility/monads.py (MonadicDictCursor.fetchone): Return monadic value.
Diffstat (limited to 'wqflask/utility/monads.py')
-rw-r--r--wqflask/utility/monads.py2
1 files changed, 1 insertions, 1 deletions
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):