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

feat: simplify withSchema API #14359

Merged
merged 5 commits into from
Apr 11, 2022
Merged

feat: simplify withSchema API #14359

merged 5 commits into from
Apr 11, 2022

Conversation

ephys
Copy link
Member

@ephys ephys commented Apr 11, 2022

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • Does yarn test or yarn test-DIALECT pass with this change (including linting)?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description Of Change

As a follow up to #14337. While we're renaming Model.schema to Model.withSchema, we might as well simplify its API. I changed it from:

MyModel.schema('public');
MyModel.schema('public', /* schema delimiter */ '.');
MyModel.schema('public', { schemaDelimiter: '.' });

to

MyModel.withSchema('public');
MyModel.withSchema({ schema: 'public', schemaDelimiter: '.' });

Not a breaking change because .schema keeps its old API and .withSchema hasn't been released yet

@fzn0x fzn0x added type: feature For issues and PRs. For new features. Never breaking changes. type: refactor For issues and PRs. Things that improve the code readability, maintainability, testability, etc. labels Apr 11, 2022
Copy link
Member

@WikiRik WikiRik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one question, but it's non-blocking

test/support.d.ts Show resolved Hide resolved
@WikiRik WikiRik merged commit e8b37c2 into main Apr 11, 2022
@WikiRik WikiRik deleted the ephys/with-schema-tweak branch April 11, 2022 12:00
@github-actions
Copy link
Contributor

🎉 This PR is included in version 7.0.0-alpha.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

vanthome pushed a commit to vanthome/sequelize that referenced this pull request Jun 12, 2022
* feat: simplify withSchema API

* feat: add check to ensure people migrate properly

* fix: normalize schema to empty string

* test: fixb roken test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @v7 type: feature For issues and PRs. For new features. Never breaking changes. type: refactor For issues and PRs. Things that improve the code readability, maintainability, testability, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants