refactor: move Sequelize query executor out of DAL into backend - #4325
Merged
Conversation
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Contributor
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Contributor
There was a problem hiding this comment.
Pull request overview
Moves the legacy Sequelize QueryExecutor adapter from the shared DAL into the backend and rewires its consumers.
Changes:
- Adds the backend-local Sequelize adapter.
- Removes Sequelize from DAL dependencies.
- Updates backend imports to use the new adapter location.
Review note: Unrelated AWS lockfile rewrites should be reverted. The PR title also lacks the required JIRA key.
Reviewed changes
Copilot reviewed 29 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
services/libs/data-access-layer/src/queryExecutor.ts |
Retains database re-exports only. |
services/libs/data-access-layer/package.json |
Removes Sequelize dependency. |
pnpm-lock.yaml |
Updates dependency graph. |
backend/src/database/sequelizeQueryExecutor.ts |
Adds backend-local adapter. |
backend/src/services/organizationService.ts |
Rewires adapter import. |
backend/src/services/memberService.ts |
Rewires adapter imports. |
backend/src/services/member/memberIdentityService.ts |
Rewires adapter import. |
backend/src/database/repositories/sequelizeRepository.ts |
Uses local adapter classes. |
backend/src/database/repositories/repositoryBase.ts |
Uses local adapter factory. |
backend/src/database/repositories/organizationRepository.ts |
Rewires adapter import. |
backend/src/database/repositories/memberRepository.ts |
Rewires adapter imports. |
backend/src/bin/scripts/merge-similar-organizations.ts |
Rewires adapter import. |
backend/src/bin/scripts/merge-members.ts |
Rewires adapter import. |
backend/src/api/public/v1/organizations/getOrganization.ts |
Rewires adapter import. |
backend/src/api/public/v1/organizations/createOrganization.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/work-experiences/verifyMemberWorkExperience.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/work-experiences/updateMemberWorkExperience.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/work-experiences/getMemberWorkExperiences.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/work-experiences/deleteMemberWorkExperience.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/work-experiences/createMemberWorkExperience.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/resolveMember.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/project-affiliations/patchProjectAffiliation.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/project-affiliations/getProjectAffiliations.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/maintainer-roles/getMemberMaintainerRoles.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/identities/verifyMemberIdentity.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/identities/getMemberIdentities.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/identities/createMemberIdentity.ts |
Rewires adapter import. |
backend/src/api/public/v1/members/createMember.ts |
Rewires adapter import. |
backend/src/api/public/v1/affiliations/getAffiliations.ts |
Rewires adapter import. |
backend/src/api/public/v1/affiliations/getAffiliationByHandle.ts |
Rewires adapter import. |
backend/src/api/public/middlewares/staticApiKeyMiddleware.ts |
Rewires adapter import. |
backend/src/api/member/memberMerge.ts |
Rewires adapter import. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves the Sequelize-backed
QueryExecutorbridge out of@crowd/data-access-layerand into the backend, where Sequelize actually lives. DAL keeps the sharedQueryExecutortype and pg-promise re-exports only; backend callers importoptionsQxfrom@/database/sequelizeQueryExecutorinstead of the DAL barrel.This is a structural cleanup, not a behavior change. No API routes, repository logic, or DAL query functions were refactored beyond the import path. DAL renames and test-kit work stay in follow-up PRs.
Long term, DAL should not depend on Sequelize at all. Workers and Vitest already use
pgpQx; only the backend still runs on Sequelize repositories. Keeping the adapter in DAL forced a Sequelize devDependency on a shared package and made it easy for test imports to pull legacy ORM code unintentionally.Changes
backend/src/database/sequelizeQueryExecutor.tswithSequelizeQueryExecutor,TransactionalSequelizeQueryExecutor,optionsQx, andoptionsBgQxservices/libs/data-access-layer/src/queryExecutor.tsto pg-promise re-exports and theQueryExecutortype onlysequelizefrom@crowd/data-access-layerdevDependenciesoptionsQx/optionsBgQximports across API handlers, services, scripts, and repositories to@/database/sequelizeQueryExecutorpnpm-lock.yamlfor the DAL sequelize removal