code: function bulkUpsert(connection, model, data, done) {
    var query;
    var n = connection.connectionManager.dialectName;
    // Note that the UPSERT type is needed so that SQLite can run multiple statements,
    // specifically use the .exec method of the underlying sqlite library.
    var options = {
      type: connection.QueryTypes.UPSERT,
      raw: true
    };
  
    // Make query based on dialiect
    if (n === "mysql" || n === "mariadb" || n === "mysqli") {
      query = mysqlBulkUpsert(model, data);
    }
    else if (n === "sqlite") {
      query = sqliteBulkUpsert(model, data);
    }
    else if (n === "pgsql" || n === "postgres") {
      query = pgsqlBulkUpsert(model, data);
      options.type = connection.QueryTypes.INSERT;
    }
  
    // Run query
    if (_.isObject(query)) {
      options.replacements = query.replacements;
      runQuery(connection, query.query, options, done);
    }
    else if (query) {
      runQuery(connection, query, options, done);
    }
    else {
      done(new Error("Could not create query for bulkUpsert."));
    }
  }
docs: A wrapper to do a bulk upsert (ie multiple statements)