@@ -31,7 +31,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
31
31
32
32
@override
33
33
Future <int > delete (String table, {String ? where, List <Object ?>? whereArgs}) {
34
- Future <int > future () async {
34
+ return Future <int >( () async {
35
35
final currentSpan = _parentSpan ?? _hub.getSpan ();
36
36
final builder =
37
37
SqlBuilder .delete (table, where: where, whereArgs: whereArgs);
@@ -55,14 +55,12 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
55
55
} finally {
56
56
await span? .finish ();
57
57
}
58
- }
59
-
60
- return future ();
58
+ });
61
59
}
62
60
63
61
@override
64
62
Future <void > execute (String sql, [List <Object ?>? arguments]) {
65
- Future <void > future () async {
63
+ return Future <void >( () async {
66
64
final currentSpan = _parentSpan ?? _hub.getSpan ();
67
65
final span = currentSpan? .startChild (
68
66
SentryDatabase .dbSqlExecuteOp,
@@ -81,9 +79,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
81
79
} finally {
82
80
await span? .finish ();
83
81
}
84
- }
85
-
86
- return future ();
82
+ });
87
83
}
88
84
89
85
@override
@@ -93,7 +89,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
93
89
String ? nullColumnHack,
94
90
ConflictAlgorithm ? conflictAlgorithm,
95
91
}) {
96
- Future <int > future () async {
92
+ return Future <int >( () async {
97
93
final currentSpan = _parentSpan ?? _hub.getSpan ();
98
94
final builder = SqlBuilder .insert (
99
95
table,
@@ -125,9 +121,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
125
121
} finally {
126
122
await span? .finish ();
127
123
}
128
- }
129
-
130
- return future ();
124
+ });
131
125
}
132
126
133
127
@override
@@ -143,7 +137,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
143
137
int ? limit,
144
138
int ? offset,
145
139
}) {
146
- Future <List <Map <String , Object ?>>> future () async {
140
+ return Future <List <Map <String , Object ?>>>( () async {
147
141
final currentSpan = _parentSpan ?? _hub.getSpan ();
148
142
final builder = SqlBuilder .query (
149
143
table,
@@ -187,9 +181,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
187
181
} finally {
188
182
await span? .finish ();
189
183
}
190
- }
191
-
192
- return future ();
184
+ });
193
185
}
194
186
195
187
@override
@@ -206,7 +198,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
206
198
int ? offset,
207
199
int ? bufferSize,
208
200
}) {
209
- Future <QueryCursor > future () async {
201
+ return Future <QueryCursor >( () async {
210
202
final currentSpan = _parentSpan ?? _hub.getSpan ();
211
203
final builder = SqlBuilder .query (
212
204
table,
@@ -251,14 +243,12 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
251
243
} finally {
252
244
await span? .finish ();
253
245
}
254
- }
255
-
256
- return future ();
246
+ });
257
247
}
258
248
259
249
@override
260
250
Future <int > rawDelete (String sql, [List <Object ?>? arguments]) {
261
- Future <int > future () async {
251
+ return Future <int >( () async {
262
252
final currentSpan = _parentSpan ?? _hub.getSpan ();
263
253
final span = currentSpan? .startChild (
264
254
SentryDatabase .dbSqlExecuteOp,
@@ -279,14 +269,12 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
279
269
} finally {
280
270
await span? .finish ();
281
271
}
282
- }
283
-
284
- return future ();
272
+ });
285
273
}
286
274
287
275
@override
288
276
Future <int > rawInsert (String sql, [List <Object ?>? arguments]) {
289
- Future <int > future () async {
277
+ return Future <int >( () async {
290
278
final currentSpan = _parentSpan ?? _hub.getSpan ();
291
279
final span = currentSpan? .startChild (
292
280
SentryDatabase .dbSqlExecuteOp,
@@ -307,17 +295,15 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
307
295
} finally {
308
296
await span? .finish ();
309
297
}
310
- }
311
-
312
- return future ();
298
+ });
313
299
}
314
300
315
301
@override
316
302
Future <List <Map <String , Object ?>>> rawQuery (
317
303
String sql, [
318
304
List <Object ?>? arguments,
319
305
]) {
320
- Future <List <Map <String , Object ?>>> future () async {
306
+ return Future <List <Map <String , Object ?>>>( () async {
321
307
final currentSpan = _parentSpan ?? _hub.getSpan ();
322
308
final span = currentSpan? .startChild (
323
309
SentryDatabase .dbSqlQueryOp,
@@ -338,9 +324,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
338
324
} finally {
339
325
await span? .finish ();
340
326
}
341
- }
342
-
343
- return future ();
327
+ });
344
328
}
345
329
346
330
@override
@@ -349,7 +333,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
349
333
List <Object ?>? arguments, {
350
334
int ? bufferSize,
351
335
}) {
352
- Future <QueryCursor > future () async {
336
+ return Future <QueryCursor >( () async {
353
337
final currentSpan = _parentSpan ?? _hub.getSpan ();
354
338
final span = currentSpan? .startChild (
355
339
SentryDatabase .dbSqlQueryOp,
@@ -374,14 +358,12 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
374
358
} finally {
375
359
await span? .finish ();
376
360
}
377
- }
378
-
379
- return future ();
361
+ });
380
362
}
381
363
382
364
@override
383
365
Future <int > rawUpdate (String sql, [List <Object ?>? arguments]) {
384
- Future <int > future () async {
366
+ return Future <int >( () async {
385
367
final currentSpan = _parentSpan ?? _hub.getSpan ();
386
368
final span = currentSpan? .startChild (
387
369
SentryDatabase .dbSqlExecuteOp,
@@ -402,9 +384,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
402
384
} finally {
403
385
await span? .finish ();
404
386
}
405
- }
406
-
407
- return future ();
387
+ });
408
388
}
409
389
410
390
@override
@@ -415,7 +395,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
415
395
List <Object ?>? whereArgs,
416
396
ConflictAlgorithm ? conflictAlgorithm,
417
397
}) {
418
- Future <int > future () async {
398
+ return Future <int >( () async {
419
399
final currentSpan = _parentSpan ?? _hub.getSpan ();
420
400
final builder = SqlBuilder .update (
421
401
table,
@@ -449,8 +429,6 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
449
429
} finally {
450
430
await span? .finish ();
451
431
}
452
- }
453
-
454
- return future ();
432
+ });
455
433
}
456
434
}
0 commit comments