Repository: sequelize/sequelize
File: packages/core/src/sequelize.js (JavaScript)

Code before:
              type: options.type === 'SELECT' ? 'read' : 'write',
            });

      if (this.dialect.name === 'db2' && options.alter && options.alter.drop === false) {
        connection.dropTable = false;
      }

      const query = new this.dialect.Query(connection, this, options);

      try {
        await this.hooks.runAsync('beforeQuery', options, query);
        checkTransaction();

        return await query.run(sql, bindParameters, { minifyAliases: options.minifyAliases });
      } finally {
        await this.hooks.runAsync('afterQuery', options, query);
        if (!options.transaction && !options.connection) {
          this.connectionManager.releaseConnection(connection);
        }
      }
    }, retryOptions);
  }

  /**
   * Execute a query which would set an environment or user variable. The variables are set per connection, so this function needs a transaction.
   * Only works for MySQL or MariaDb.
   *
   * @param {object} variables Object with multiple variables.
   * @param {object} [options] query options.
   *
   * @returns {Promise}
   */
  async setSessionVariables(variables, options) {
    // Prepare options
    options = { ...this.options.setSessionVariables, ...options };

    if (!['mysql', 'mariadb'].includes(this.dialect.name)) {
      throw new Error('sequelize.setSessionVariables is only supported for mysql or mariadb');
    }

    setTransactionFromCls(options, this);

    if (
      (!options.transaction || !(options.transaction instanceof Transaction)) &&
      !options.connection
    ) {
      throw new Error(
        'You must specify either options.transaction or options.connection, as sequelize.setSessionVariables is used to set the session options of a connection',
      );
    }


Review comment (suggestion):
```suggestion
   * Only works for MySQL or MariaDB.
```


Code after:
              type: options.type === 'SELECT' ? 'read' : 'write',
            });

      if (this.dialect.name === 'db2' && options.alter && options.alter.drop === false) {
        connection.dropTable = false;
      }

      const query = new this.dialect.Query(connection, this, options);

      try {
        await this.hooks.runAsync('beforeQuery', options, query);
        checkTransaction();

        return await query.run(sql, bindParameters, { minifyAliases: options.minifyAliases });
      } finally {
        await this.hooks.runAsync('afterQuery', options, query);
        if (!options.transaction && !options.connection) {
          this.connectionManager.releaseConnection(connection);
        }
      }
    }, retryOptions);
  }

  /**
   * Execute a query which would set an environment or user variable. The variables are set per connection, so this function needs a transaction.
   * Only works for MySQL or MariaDB.
   *
   * @param {object} variables Object with multiple variables.
   * @param {object} [options] query options.
   *
   * @returns {Promise}
   */
  async setSessionVariables(variables, options) {
    // Prepare options
    options = { ...this.options.setSessionVariables, ...options };

    if (!['mysql', 'mariadb'].includes(this.dialect.name)) {
      throw new Error('sequelize.setSessionVariables is only supported for mysql or mariadb');
    }

    setTransactionFromCls(options, this);

    if (
      (!options.transaction || !(options.transaction instanceof Transaction)) &&
      !options.connection
    ) {
      throw new Error(
        'You must specify either options.transaction or options.connection, as sequelize.setSessionVariables is used to set the session options of a connection',
      );
    }