11import { Readable } from 'node:stream'
22import { promisify } from 'node:util'
33import {
4- DBPatch ,
54 BaseCommonDB ,
65 CommonDB ,
76 CommonDBCreateOptions ,
7+ commonDBFullSupport ,
88 CommonDBOptions ,
99 CommonDBSaveOptions ,
10- DBQuery ,
11- RunQueryResult ,
1210 CommonDBSupport ,
13- commonDBFullSupport ,
1411 CommonDBType ,
12+ DBPatch ,
13+ DBQuery ,
14+ RunQueryResult ,
1515} from '@naturalcycles/db-lib'
1616import {
1717 _assert ,
@@ -253,7 +253,7 @@ export class MysqlDB extends BaseCommonDB implements CommonDB {
253253 . map ( s => s . trim ( ) )
254254 . filter ( Boolean )
255255
256- for await ( const sql of queries ) {
256+ for ( const sql of queries ) {
257257 await this . runSQL ( { sql } )
258258 }
259259 }
@@ -310,7 +310,7 @@ export class MysqlDB extends BaseCommonDB implements CommonDB {
310310 // Insert rows one-by-one, to get their auto-generated id
311311
312312 let i = - 1
313- for await ( const row of rows ) {
313+ for ( const row of rows ) {
314314 i ++
315315 if ( row . id ) {
316316 // Update already existing
@@ -331,7 +331,7 @@ export class MysqlDB extends BaseCommonDB implements CommonDB {
331331
332332 if ( opt . saveMethod === 'update' ) {
333333 // TODO: This fails if a combination of entities with id and without id are parsed
334- for await ( const row of rows ) {
334+ for ( const row of rows ) {
335335 // Update already existing
336336 _assert ( row . id , 'id is required for updating' )
337337 const query = new DBQuery ( table ) . filterEq ( 'id' , row . id )
@@ -344,7 +344,7 @@ export class MysqlDB extends BaseCommonDB implements CommonDB {
344344 // inserts are split into multiple sentenses to respect the max_packet_size (1Mb usually)
345345 const sqls = insertSQL ( table , rows , verb , this . cfg . logger )
346346
347- for await ( const sql of sqls ) {
347+ for ( const sql of sqls ) {
348348 await this . runSQL ( { sql } )
349349 }
350350 }
0 commit comments