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

Simplify ORM #6373

Merged
merged 3 commits into from
Jul 23, 2024
Merged

Simplify ORM #6373

merged 3 commits into from
Jul 23, 2024

Conversation

charlesBochet
Copy link
Member

@charlesBochet charlesBochet commented Jul 23, 2024

This PR refactors the ORM-Manager to simplify and unify the datasource creation. I'm deprecating all usages if InjectWorkspaceDatasource and InjectWorkspaceRepository as we can't be sure they are up-to-date

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR refactors the ORM-Manager to simplify and unify the datasource creation process.

  • Removed outdated upgrade commands and modules in packages/twenty-server/src/database/commands/upgrade-version/0-22/.
  • Refactored workspace-datasource.factory.ts to introduce caching mechanisms for workspace data sources.
  • Updated google-apis.service.ts to dynamically obtain the workspace data source using TwentyORMManager.
  • Deleted inject-workspace-datasource.decorator.ts and inject-workspace-repository.decorator.ts to streamline dependency injection.
  • Modified twenty-orm.manager.ts to consolidate repository and datasource retrieval logic.

23 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

Comment on lines +18 to 21
const workspaceDataSource = await this.workspaceDataSourceFactory.create(
workspaceId,
null,
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic: Potential issue: Removing cache version handling might affect performance and data consistency.

@bosiraphael
Copy link
Contributor

I tested the messages and calendar syncs for this PR and it works well.

@charlesBochet charlesBochet merged commit 6c34ef9 into main Jul 23, 2024
6 checks passed
@charlesBochet charlesBochet deleted the simplify-orm branch July 23, 2024 12: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.

2 participants