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: Migrate the rest of QI schema methods to TS #15498

Merged
merged 20 commits into from
Feb 16, 2023

Conversation

evanrittenhouse
Copy link
Member

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • If a documentation update is necessary, have you opened a PR to the documentation repository?
  • 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?
  • Does the name of your PR follow our conventions?

Description Of Change

Migrate the rest of QueryInterface schema methods to TypeScript

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.

One quick comment, I'll let you work on this further yourself. Feel free to let us know if you have any questions

src/dialects/abstract/query-interface.js Outdated Show resolved Hide resolved
@evanrittenhouse
Copy link
Member Author

The tests are failing because of Unknown database: sequelize_test on my local branch and when I check out upstream/main (main of the GitHub repo).

What's odd is that on upstream/main, if I stop/restart the container it'll work. Super weird, considering I didn't make any changes to the database methods. Any ideas?

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 think it's fine that we do not use drop for dialects that do not support schemas. These should not use dropAllSchemas in the first place imo.

test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface.types.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
@evanrittenhouse
Copy link
Member Author

@WikiRik I'm stumped. Do you why, on MySQL and MariaDB, [MYSQL] Replication connection objects should be able to make a write would fail after dropAllSchemas() runs? I've confirmed that the test database is being recreated

@evanrittenhouse evanrittenhouse marked this pull request as ready for review January 10, 2023 06:20
@evanrittenhouse evanrittenhouse requested a review from a team January 10, 2023 06:20
@evanrittenhouse
Copy link
Member Author

Only outstanding question I have is whether we want to deprecate the equivalent methods in sequelize.js. @WikiRik @ephys thoughts?

@WikiRik
Copy link
Member

WikiRik commented Jan 10, 2023

Only outstanding question I have is whether we want to deprecate the equivalent methods in sequelize.js. @WikiRik @ephys thoughts?

Probably in the future, but for now I don't think that is necessary. But I'm fine either way

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.

Few comments, but I think we're getting close

src/dialects/abstract/query-interface.types.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
@evanrittenhouse evanrittenhouse force-pushed the query_interface_typescript branch 2 times, most recently from 02ea0bb to 51eda04 Compare January 12, 2023 02:14
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.

Few additional comments

test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
@ephys ephys self-requested a review January 14, 2023 17:03
ephys
ephys previously requested changes Jan 14, 2023
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-generator.types.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-generator.types.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
src/dialects/abstract/query-interface-typescript.ts Outdated Show resolved Hide resolved
test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
test/integration/query-interface/schemas.test.ts Outdated Show resolved Hide resolved
@evanrittenhouse evanrittenhouse force-pushed the query_interface_typescript branch 2 times, most recently from fb35ccd to a22dbd8 Compare January 15, 2023 20:21
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.

Two suggestions regarding the types, after those the typing tests should work I think

@evanrittenhouse evanrittenhouse force-pushed the query_interface_typescript branch 4 times, most recently from 131c2ce to c65ce08 Compare January 17, 2023 00:13
@evanrittenhouse
Copy link
Member Author

I'm going to move dropAllSchemas() to a different PR as it's preventing the release of the rest of the methods. I haven't been able to sort out the cause of the flaky integration tests.

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.

Two small comments. If you commit the type back we should be good to go

packages/core/src/dialects/abstract/query-interface.d.ts Outdated Show resolved Hide resolved
packages/core/src/dialects/abstract/query-interface.js Outdated Show resolved Hide resolved
@WikiRik WikiRik requested a review from ephys February 2, 2023 17:28
WikiRik
WikiRik previously approved these changes Feb 2, 2023
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.

Looks good to me. I'll give some time for @ephys to look at it again before we merge

@WikiRik WikiRik merged commit a785609 into sequelize:main Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants