Use doWhenOpened for custom updates and inserts

This commit is contained in:
Simon Binder 2019-08-30 09:16:55 +02:00
parent 876db0671e
commit 0ef56d6163
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 2 additions and 1 deletions

View File

@ -207,7 +207,8 @@ mixin QueryEngine on DatabaseConnectionUser {
final ctx = GenerationContext.fromDb(engine);
final mappedArgs = variables.map((v) => v.mapToSimpleValue(ctx)).toList();
final result = await writer(executor, query, mappedArgs);
final result =
await executor.doWhenOpened((e) => writer(e, query, mappedArgs));
if (updates != null) {
await engine.streamQueries.handleTableUpdates(updates);