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 version queries to typescript #16153

Merged
merged 6 commits into from
Jun 21, 2023
Merged

feat: migrate version queries to typescript #16153

merged 6 commits into from
Jun 21, 2023

Conversation

ephys
Copy link
Member

@ephys ephys commented Jun 20, 2023

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

This PR migrates queries related to getting the database version to TypeScript, as well as a few simple ones that only required moving to the code to the typescript file.

The real goal of the file is to implement a way to have internal code in query interface that cannot be accessed from the public API, but can still be modified by dialects.

This was done using AbstractQueryInterfaceInternal, see its uses in AbstractQueryInterfaceTypeScript and PostgresQueryInterfaceTypeScript. In the current implementation, Postgres does not replace the class with its own implementation, but it can when it starts needing to do that.

I also moved the logic for processing version queries out of query.js and into the query interface, with the long term goal of removing the query types used to format what are simple selects (VERSION, SHOWCONSTRAINTS, FOREIGNKEYS, DESCRIBE, SHOWINDEXES, SHOWTABLES)

Breaking Changes

  • QueryTypes.VERSION has been removed
  • AbstractQueryInterface#databaseVersion has been renamed to AbstractQueryInterface#fetchDatabaseVersion

@ephys ephys marked this pull request as draft June 21, 2023 06:06
@ephys ephys marked this pull request as ready for review June 21, 2023 17:13
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 small question, but apart from that great work. I like that we limit the QueryTypes and nice that you started on the internal QI

packages/core/src/sequelize-typescript.ts Outdated Show resolved Hide resolved
@WikiRik WikiRik added this pull request to the merge queue Jun 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 21, 2023
@WikiRik WikiRik added this pull request to the merge queue Jun 21, 2023
Merged via the queue into main with commit 37dbf08 Jun 21, 2023
49 checks passed
@WikiRik WikiRik deleted the ephys/version-to-ts branch June 21, 2023 20:13
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

2 participants