@@ -303,22 +303,51 @@ void main() {
303303 )
304304 });
305305
306- test ('executeMultiple inserts multiple rows' , () async {
306+ test ('execute single statement with RETURNING populates ResultSet' ,
307+ () async {
308+ final db = await testUtils.setupDatabase (path: path);
309+ await createTables (db);
310+ final result = await db.execute (
311+ 'INSERT INTO test_data(description) VALUES(?) RETURNING id, description' ,
312+ ['test returning with params' ]);
313+
314+ expect (result.columnNames, equals (['id' , 'description' ]));
315+ expect (result.rows.length, equals (1 ));
316+ expect (result.rows[0 ][0 ], isA <int >());
317+ expect (result.rows[0 ][1 ], equals ('test returning with params' ));
318+ });
319+
320+ test (
321+ 'execute single statment with RETURNING populates ResultSet without params' ,
322+ () async {
307323 final db = await testUtils.setupDatabase (path: path);
308324 await createTables (db);
325+ final result = await db.execute (
326+ 'INSERT INTO test_data(description) VALUES("test returning without params") RETURNING id, description' );
309327
310- await db.executeMultiple ('''
328+ expect (result.columnNames, equals (['id' , 'description' ]));
329+ expect (result.rows.length, equals (1 ));
330+ expect (result.rows[0 ][0 ], isA <int >());
331+ expect (result.rows[0 ][1 ], equals ('test returning without params' ));
332+ });
333+
334+ test ('execute handles multiple statements' , () async {
335+ final db = await testUtils.setupDatabase (path: path);
336+ await createTables (db);
337+
338+ await db.execute ('''
311339 INSERT INTO test_data(description) VALUES('row1');
312340 INSERT INTO test_data(description) VALUES('row2');
313341 ''' );
314342
315- final results = await db.getAll ('SELECT description FROM test_data ORDER BY id' );
343+ final results =
344+ await db.getAll ('SELECT description FROM test_data ORDER BY id' );
316345 expect (results.length, equals (2 ));
317346 expect (results.rows[0 ], equals (['row1' ]));
318347 expect (results.rows[1 ], equals (['row2' ]));
319348
320349 await db.close ();
321- }, skip : _isWeb ? 'executeMultiple is not supported on web' : null );
350+ });
322351
323352 test ('with all connections' , () async {
324353 final maxReaders = _isWeb ? 0 : 3 ;
0 commit comments