Skip to content

feat: simplify withSchema API - #14359

Merged
WikiRik merged 5 commits into
mainfrom
ephys/with-schema-tweak
Apr 11, 2022
Merged

WikiRik merged 5 commits into
mainfrom
ephys/with-schema-tweak

Conversation

@ephys

@ephys ephys commented Apr 11, 2022 •

Copy link
Copy Markdown
Member

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 DEPRECATED: replace with the "feature" issue type type: refactor DEPRECATED: replace with the "meta" issue type labels Apr 11, 2022
@ephys ephys mentioned this pull request Apr 11, 2022
8 of 15 tasks

@WikiRik WikiRik left a comment

Copy link
Copy Markdown
Member

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

Comment thread test/support.d.ts 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
Copy Markdown
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 DEPRECATED: replace with the "feature" issue type type: refactor DEPRECATED: replace with the "meta" issue type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants