Skip to content

Commit 6523cb3

Browse files
committed
fix update statements.
1 parent 53a7fcf commit 6523cb3

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/src/database_access.dart

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class DatabaseTransactionBase<TABLES extends TablesBase> {
6666
final setArgs = setContainsOptional ? flattenOptionals(set) : set;
6767
final setStatement =
6868
setArgs.entries.map((e) => '${e.key} = @s${e.key}').join(',');
69-
final whereStatement = where.entries.map((e) {
69+
final whereStatement = where.entries.toList(growable: false).map((e) {
7070
if (identical(e.value, whereIsNull)) {
7171
where.remove(e.key);
7272
return '${e.key} IS NULL';
@@ -140,10 +140,17 @@ class DatabaseTransactionBase<TABLES extends TablesBase> {
140140
bool allowReuse = true,
141141
int? timeoutInSeconds}) async {
142142
assert(_assertCorrectValues(values));
143-
return _conn.query(fmtString,
144-
substitutionValues: values,
145-
allowReuse: allowReuse,
146-
timeoutInSeconds: timeoutInSeconds);
143+
try {
144+
// _logger.finest('QUERY: $fmtString');
145+
return _conn.query(fmtString,
146+
substitutionValues: values,
147+
allowReuse: allowReuse,
148+
timeoutInSeconds: timeoutInSeconds);
149+
} catch (e, stackTrace) {
150+
_logger.warning(
151+
'Error while running statement $fmtString', e, stackTrace);
152+
rethrow;
153+
}
147154
}
148155
}
149156

0 commit comments

Comments
 (0)