Commit efcb98fa authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Wrap INSERTs inside transactions to speed things up.

parent 15880caa
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -461,9 +461,11 @@ function asyncPrint(msg) {

function printInserts(table) {
    return function(data, next) {
        console.log("START TRANSACTION;");
        data[table].map(fixBooleans).forEach(function(row) {
            console.log(db.format("INSERT INTO "+table+" SET ?;", row));
        });
        console.log("COMMIT;");
        next();
    };
}