You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
statement.each takes 2 callbacks, first one gets called for each row, whereas 2nd one once all rows are over. This is also reflected by the underlying C code. But, on using it, it seems 2nd callback never gets called.
Test code:
importduckdbfrom'duckdb';// Create a new database instance and connect to itconstdb=newduckdb.Database('./duckdb_file.duckdb',duckdb.OPEN_READWRITE);db.serialize(()=>{conststmt=db.prepare('SELECT * FROM table_1 limit ?');letcount=0;stmt.each(10000,(err,row)=>{if(err){console.error('Error:',err);return;}//console.log(row);count++;},()=>{console.log(`Query completed. count: ${count}`);// Finalize the statement when donestmt.finalize();});});// Close the databasedb.close((err)=>{if(err){console.error('Error closing the database:',err);}else{console.log('Database closed.');}});
The text was updated successfully, but these errors were encountered:
Problem Statement
statement.each
takes 2 callbacks, first one gets called for each row, whereas 2nd one once all rows are over. This is also reflected by the underlying C code. But, on using it, it seems 2nd callback never gets called.Test code:
The text was updated successfully, but these errors were encountered: