raise on exception in connection, fix operator not being considered in QueryBuilder
This commit is contained in:
@@ -31,6 +31,7 @@ class DB:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
if in_transaction and self._connection:
|
if in_transaction and self._connection:
|
||||||
conn.rollback()
|
conn.rollback()
|
||||||
|
raise
|
||||||
finally:
|
finally:
|
||||||
if in_transaction:
|
if in_transaction:
|
||||||
self._transaction_depth -= 1
|
self._transaction_depth -= 1
|
||||||
@@ -126,7 +127,7 @@ class DB:
|
|||||||
def where(self, condition, operator = "="):
|
def where(self, condition, operator = "="):
|
||||||
if isinstance(condition, dict):
|
if isinstance(condition, dict):
|
||||||
for key, value in condition.items():
|
for key, value in condition.items():
|
||||||
self._where.append((key, "=", value))
|
self._where.append((key, operator, value))
|
||||||
elif isinstance(condition, list):
|
elif isinstance(condition, list):
|
||||||
for c in condition:
|
for c in condition:
|
||||||
self._where.append(c)
|
self._where.append(c)
|
||||||
|
|||||||
Reference in New Issue
Block a user