Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: support 'schema' for MySQL #17302

Open
4 of 8 tasks
Snapperfish opened this issue May 2, 2024 · 1 comment
Open
4 of 8 tasks

Feature Request: support 'schema' for MySQL #17302

Snapperfish opened this issue May 2, 2024 · 1 comment
Labels
dialect: mysql For issues and PRs. Things that involve MySQL (and do not involve all dialects). type: feature For issues and PRs. For new features. Never breaking changes. v6

Comments

@Snapperfish
Copy link

Issue Creation Checklist

  • I understand that my issue will be automatically closed if I don't fill in the requested information
  • I have read the contribution guidelines

Feature Description

Describe the feature you'd like to see implemented

The documents state:

Apply a schema to this model. For postgres, this will actually place the schema in front of the table name - "schema"."tableName", while the schema will be prepended to the table name for mysql and sqlite - 'schema.tablename'.

I would like to use the 'schema' feature for MySQL. Prepending the schema to the table name does not work in MySQL.

Sequelize/MySQL supports schema if I use the following hack:
sequelize.dialect.supports.schemas = true

The request is that Sequelize implements this feature for MySQL as for Postgres, without the need for the above hack.

Describe why you would like this feature to be added to Sequelize

This feature would allow joins across databases without the need for the above hack.

Is this feature dialect-specific?

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

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 will need guidance.
  • No, I don't have the time, but my company or I are supporting Sequelize through donations on OpenCollective.
  • No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in implementing my feature.

Indicate your interest in the addition of this feature by adding the 👍 reaction. Comments such as "+1" will be removed.

@Snapperfish Snapperfish added pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet type: feature For issues and PRs. For new features. Never breaking changes. labels May 2, 2024
@WikiRik
Copy link
Member

WikiRik commented May 5, 2024

Since we have this enabled for MariaDB on v6, I think the code should be there to support schemas for MySQL as well. But when working on v7 we have significantly improved the support for schemas. If your project is not running on production yet, I would recommend checking out the v7 alphas. We're not going to make any major breaking changes anymore to it, so you can start using it for new projects or migrating old projects to non-production environments.

@WikiRik WikiRik added dialect: mysql For issues and PRs. Things that involve MySQL (and do not involve all dialects). v6 pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet and removed pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet labels May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialect: mysql For issues and PRs. Things that involve MySQL (and do not involve all dialects). type: feature For issues and PRs. For new features. Never breaking changes. v6
Projects
None yet
Development

No branches or pull requests

2 participants