@@ -31,7 +31,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
3131
3232 @override
3333 Future <int > delete (String table, {String ? where, List <Object ?>? whereArgs}) {
34- Future <int > future () async {
34+ return Future <int >( () async {
3535 final currentSpan = _parentSpan ?? _hub.getSpan ();
3636 final builder =
3737 SqlBuilder .delete (table, where: where, whereArgs: whereArgs);
@@ -55,14 +55,12 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
5555 } finally {
5656 await span? .finish ();
5757 }
58- }
59-
60- return future ();
58+ });
6159 }
6260
6361 @override
6462 Future <void > execute (String sql, [List <Object ?>? arguments]) {
65- Future <void > future () async {
63+ return Future <void >( () async {
6664 final currentSpan = _parentSpan ?? _hub.getSpan ();
6765 final span = currentSpan? .startChild (
6866 SentryDatabase .dbSqlExecuteOp,
@@ -81,9 +79,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
8179 } finally {
8280 await span? .finish ();
8381 }
84- }
85-
86- return future ();
82+ });
8783 }
8884
8985 @override
@@ -93,7 +89,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
9389 String ? nullColumnHack,
9490 ConflictAlgorithm ? conflictAlgorithm,
9591 }) {
96- Future <int > future () async {
92+ return Future <int >( () async {
9793 final currentSpan = _parentSpan ?? _hub.getSpan ();
9894 final builder = SqlBuilder .insert (
9995 table,
@@ -125,9 +121,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
125121 } finally {
126122 await span? .finish ();
127123 }
128- }
129-
130- return future ();
124+ });
131125 }
132126
133127 @override
@@ -143,7 +137,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
143137 int ? limit,
144138 int ? offset,
145139 }) {
146- Future <List <Map <String , Object ?>>> future () async {
140+ return Future <List <Map <String , Object ?>>>( () async {
147141 final currentSpan = _parentSpan ?? _hub.getSpan ();
148142 final builder = SqlBuilder .query (
149143 table,
@@ -187,9 +181,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
187181 } finally {
188182 await span? .finish ();
189183 }
190- }
191-
192- return future ();
184+ });
193185 }
194186
195187 @override
@@ -206,7 +198,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
206198 int ? offset,
207199 int ? bufferSize,
208200 }) {
209- Future <QueryCursor > future () async {
201+ return Future <QueryCursor >( () async {
210202 final currentSpan = _parentSpan ?? _hub.getSpan ();
211203 final builder = SqlBuilder .query (
212204 table,
@@ -251,14 +243,12 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
251243 } finally {
252244 await span? .finish ();
253245 }
254- }
255-
256- return future ();
246+ });
257247 }
258248
259249 @override
260250 Future <int > rawDelete (String sql, [List <Object ?>? arguments]) {
261- Future <int > future () async {
251+ return Future <int >( () async {
262252 final currentSpan = _parentSpan ?? _hub.getSpan ();
263253 final span = currentSpan? .startChild (
264254 SentryDatabase .dbSqlExecuteOp,
@@ -279,14 +269,12 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
279269 } finally {
280270 await span? .finish ();
281271 }
282- }
283-
284- return future ();
272+ });
285273 }
286274
287275 @override
288276 Future <int > rawInsert (String sql, [List <Object ?>? arguments]) {
289- Future <int > future () async {
277+ return Future <int >( () async {
290278 final currentSpan = _parentSpan ?? _hub.getSpan ();
291279 final span = currentSpan? .startChild (
292280 SentryDatabase .dbSqlExecuteOp,
@@ -307,17 +295,15 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
307295 } finally {
308296 await span? .finish ();
309297 }
310- }
311-
312- return future ();
298+ });
313299 }
314300
315301 @override
316302 Future <List <Map <String , Object ?>>> rawQuery (
317303 String sql, [
318304 List <Object ?>? arguments,
319305 ]) {
320- Future <List <Map <String , Object ?>>> future () async {
306+ return Future <List <Map <String , Object ?>>>( () async {
321307 final currentSpan = _parentSpan ?? _hub.getSpan ();
322308 final span = currentSpan? .startChild (
323309 SentryDatabase .dbSqlQueryOp,
@@ -338,9 +324,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
338324 } finally {
339325 await span? .finish ();
340326 }
341- }
342-
343- return future ();
327+ });
344328 }
345329
346330 @override
@@ -349,7 +333,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
349333 List <Object ?>? arguments, {
350334 int ? bufferSize,
351335 }) {
352- Future <QueryCursor > future () async {
336+ return Future <QueryCursor >( () async {
353337 final currentSpan = _parentSpan ?? _hub.getSpan ();
354338 final span = currentSpan? .startChild (
355339 SentryDatabase .dbSqlQueryOp,
@@ -374,14 +358,12 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
374358 } finally {
375359 await span? .finish ();
376360 }
377- }
378-
379- return future ();
361+ });
380362 }
381363
382364 @override
383365 Future <int > rawUpdate (String sql, [List <Object ?>? arguments]) {
384- Future <int > future () async {
366+ return Future <int >( () async {
385367 final currentSpan = _parentSpan ?? _hub.getSpan ();
386368 final span = currentSpan? .startChild (
387369 SentryDatabase .dbSqlExecuteOp,
@@ -402,9 +384,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
402384 } finally {
403385 await span? .finish ();
404386 }
405- }
406-
407- return future ();
387+ });
408388 }
409389
410390 @override
@@ -415,7 +395,7 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
415395 List <Object ?>? whereArgs,
416396 ConflictAlgorithm ? conflictAlgorithm,
417397 }) {
418- Future <int > future () async {
398+ return Future <int >( () async {
419399 final currentSpan = _parentSpan ?? _hub.getSpan ();
420400 final builder = SqlBuilder .update (
421401 table,
@@ -449,8 +429,6 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
449429 } finally {
450430 await span? .finish ();
451431 }
452- }
453-
454- return future ();
432+ });
455433 }
456434}
0 commit comments