async function executeSqlInBatches(conn, sql) {
  let batches = sql.split(SQL_BATCH_DELIMITER);

  // We loop instead of forEach due to async/await issue w/ forEach callback
  for (let i = 0; i < batches.length; i++) {
    let nonEmptyBatch = !!batches[i].trim();
    if (nonEmptyBatch) await conn.executeNow(`${batches[i]}\n`);
  }
}
/**
 * Execute a sql script on a given DB connection, but split the execution into
 * individual batches based on SQL_BATCH_DELIMITER delimiters that appear in the script
 * @param conn The DB connection
 * @param sql The sql script with at least one SQL_BATCH_DELIMITER delimiter
 */
Execute a sql script on a given DB connection, but split the execution into
individual batches based on SQL_BATCH_DELIMITER delimiters that appear in the script
@param conn The DB connection
@param sql The sql script with at least one SQL_BATCH_DELIMITER delimiter
Execute a sql script on a given DB connection but split the execution into individual batches based on SQL_BATCH_DELIMITER delimiters that appear in the script @param conn The DB connection @param sql The sql script with at least one SQL_BATCH_DELIMITER delimiter
async function executeSqlInBatches(conn, sql) {
  let batches = sql.split(SQL_BATCH_DELIMITER);
  for (let i = 0; i < batches.length; i++) {
    let nonEmptyBatch = !!batches[i].trim();
    if (nonEmptyBatch) await conn.executeNow(`${batches[i]}\n`);
  }
}
async function executeSqlInBatches ( conn , sql ) { let batches = sql . split ( SQL_BATCH_DELIMITER ) ; for ( let i = 0 ; i < batches . length ; i ++ ) { let nonEmptyBatch = ! ! batches [ i ] . trim ( ) ; if ( nonEmptyBatch ) await conn . executeNow ( ` ${ batches [ i ] } \n ` ) ; } }
Execute a sql script on a given DB connection, but split the execution into
 individual batches based on SQL_BATCH_DELIMITER delimiters that appear in the script
 @param conn The DB connection
 @param sql The sql script with at least one SQL_BATCH_DELIMITER delimiter
Execute a sql script on a given DB connection but split the execution into individual batches based on SQL_BATCH_DELIMITER delimiters that appear in the script @param conn The DB connection @param sql The sql script with at least one SQL_BATCH_DELIMITER delimiter
// We loop instead of forEach due to async/await issue w/ forEach callback