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

fix: fix various type issues #15765

Merged
merged 1 commit into from
Mar 11, 2023
Merged

fix: fix various type issues #15765

merged 1 commit into from
Mar 11, 2023

Conversation

ephys
Copy link
Member

@ephys ephys commented Mar 11, 2023

This PR fixes the following issues:

  • Fix queryGenerator selectQuery tableName typing
  • Fix queryInterface increment & decrement parameter order & typing
  • Restrict snowflake's JSON escape method param type
  • Fix typing of findByPk to accept any PK type
  • Use Object.create(null) instead of {} in a few places

This PR also imports misc refactors from PR #15598:

  • Rename SequelizeMethod -> BaseSqlExpression & split expression builders into their own individual files to prevent circular import issues
  • Move the functions that instantiate these expressions next to their classes (i.e. Fn & fn are in the same file)
  • Re-add rejectOnEmpty in belongs-to-many which was accidentally removed in fix: small tweaks to associations and decorators #15763
  • Move where-related utils to utils/where.ts
  • Add & use an immutable constant EMPTY_OBJECT instead of creating new objects for small perf optimization
  • Add internal utils used by feat: rewrite the part of QueryGenerator responsible for WHERE #15598
  • Safeguard quoteIdentifier

@ephys ephys changed the title refactor: import misc refactors from #15598 fix: fix various type issues Mar 11, 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.

Thanks for this PR! This already reduces the big PR with ~7%. Just three small questions and a suggestion but no blocking things for merging

packages/core/src/expression-builders/col.ts Show resolved Hide resolved
packages/core/src/utils/check.ts Show resolved Hide resolved
@ephys ephys merged commit 26beda5 into main Mar 11, 2023
@ephys ephys deleted the ephys/misc-refactors branch March 11, 2023 17:45
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