Skip to content

Index Hints on Mariadb dialect #11570

@benjamin658

Description

@benjamin658

Issue Description

Is your feature request related to a problem? Please describe.

Currently the indexHints option cannot be used on the mariadb dialect. If I want to use an index on a query, I have to write a raw query.

Describe the solution you'd like

Supports indexHints option when using mariadb dialect.

User.findAll({
  indexHints: [
    { type: IndexHints.USE, values: ['index_user_on_username'] }
  ],
  where: {
    username: 'xxxx'
  }
})

Why should this be in Sequelize

Sequelize supports indexHints on mysql dialect.

Describe alternatives/workarounds you've considered

Write raw query.

Issue Template Checklist

Is this issue dialect-specific?

  • No. This issue is relevant to Sequelize as a whole.
  • Yes. This issue only applies to the following dialect(s): mariadb

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don't know how to start, I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

#9421

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions