title: How can I run multiple raw queries with sequelize in MySql?
body: <p>I am trying to run a script to drop all the tables from the database before sequelize syncs via <code>sequelize.sync({ force: true });</code></p>
  
  <p>The script runs with no problems when I run it from the console, the problem happens when I try to run it from my node.js application; MySql returns a parse error.</p>
  
  <h3>node.js</h3>
  
  <pre><code>var dropAllTables = [
      'SET FOREIGN_KEY_CHECKS = 0;',
      'SET GROUP_CONCAT_MAX_LEN = 32768;',
      'SET @tables = NULL;',
      "SELECT GROUP_CONCAT('`', table_name, '`') INTO @tables FROM information_schema.tables WHERE table_schema = (SELECT DATABASE());",
      "SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables);",
      "SELECT IFNULL(@tables, 'SELECT 1') INTO @tables;",
      'PREPARE stmt FROM @tables;',
      'EXECUTE stmt;',
      'DEALLOCATE PREPARE stmt;',
      'SET FOREIGN_KEY_CHECKS = 1;',
      "SET GLOBAL sql_mode = 'STRICT_ALL_TABLES';"
  ].join(' ');
  
  sequelize.query(dropAllTables, {
      raw: true
  }).then(function() {
      return sequelize.sync({ force: true });
  }).then(function() {
      console.log('Database recreated!');
      callback();
  }, function(err) {
      throw err;
  });
  </code></pre>
  
  <h3>error</h3>
  
  <p><code>{ [Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET GROUP_CONCAT_MAX_LEN = 32768; SET @tables = NULL; SELECT GROUP_CONCAT('`', t' at line 1]
    code: 'ER_PARSE_ERROR',
    errno: 1064,
    sqlState: '42000',
    index: 0,
    sql: 'SET FOREIGN_KEY_CHECKS = 0; SET GROUP_CONCAT_MAX_LEN = 32768; SET @tables = NULL; SELECT GROUP_CONCAT(\'`\', table_name, \'`\') INTO @tables FROM information_schema.tables WHERE table_schema = (SELECT DATABASE()); SET @tables = CONCAT(\'DROP TABLE IF EXISTS \', @tables); SELECT IFNULL(@tables, \'SELECT 1\') INTO @tables; PREPARE stmt FROM @tables; EXECUTE stmt; DEALLOCATE PREPARE stmt; SET FOREIGN_KEY_CHECKS = 1; SET GLOBAL sql_mode = \'STRICT_ALL_TABLES\';' }</code></p>
  
  <p>I found nothing regarding multiple raw queries with sequelize in Google nor at <a href="https://github.com/sequelize/sequelize/wiki/API-Reference-Sequelize#query">sequelize docs page</a> (I looked for a specific parameter for the <code>query</code> method).</p>
  
  <h3>EDIT:</h3>
  
  <p>I found <a href="http://w3facility.info/question/sql-error-1064-when-trying-to-import-dump-in-node-js/">this thread</a> from an SO clone, where people seem to have the same problem but I can't figure out what the solution was.</p>