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(core): Add replicationMode for ctx and getRepository #2746

Open
wants to merge 1 commit into
base: minor
Choose a base branch
from

Conversation

monrostar
Copy link
Contributor

Description

This PR includes improvements for connecting to the database if you are using multiple replicas and when you need to connect to Master without using TransactionManager

Breaking changes

  • No

@michaelbromley
Copy link
Member

Hi,

Thanks, this looks good. Can you make a suggestion for some documentation on this feature? At least as doc blocks on the new method/property.

@monrostar
Copy link
Contributor Author

Hi,

Thanks, this looks good. Can you make a suggestion for some documentation on this feature? At least as doc blocks on the new method/property.

Of course, I will. I can do it tomorrow

): Repository<Entity>;
getRepository<Entity extends ObjectLiteral>(
ctxOrTarget: RequestContext | ObjectType<Entity> | EntitySchema<Entity> | string | undefined,
maybeTarget?: ObjectType<Entity> | EntitySchema<Entity> | string,
replicationMode?: ReplicationMode,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here it's probably better to use an object instead of a strict arg

Copy link
Member

Choose a reason for hiding this comment

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

For future extensibility?

Copy link
Contributor Author

@monrostar monrostar Apr 4, 2024

Choose a reason for hiding this comment

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

yes. For example, there may be several databases in the future

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