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

Any plans to upgrade to mikro-orm v4? #11

Open
rhyek opened this issue Jul 9, 2020 · 3 comments
Open

Any plans to upgrade to mikro-orm v4? #11

rhyek opened this issue Jul 9, 2020 · 3 comments

Comments

@rhyek
Copy link

rhyek commented Jul 9, 2020

Basically the title. v4 is already at alpha 4 and should release soon.

Thank you.

@epechuzal
Copy link

@B4nan started work on a migration guide here.

I think the breaking changes that affect us most are in the Monorepo section, but I don't know enough about how this module works to suggest a PR

@B4nan
Copy link
Collaborator

B4nan commented Jul 17, 2020

As I mentioned on slack, I do have commit rights here, but I do not have releasing under control, so if nothing changes soon, I will be forking this under mikro-orm org and maintaining it there myself (releasing under @mikro-orm/nestjs or something like that). I am not really interested in maintaining this repository (not as the only maintainer - would be happy to help, but currently there was zero activity from the author).

Other than that, this is currently compatible with v4, only thing that is problematic is injecting EntityManager, as now only the one from core is registered in DI, but not the flavoured one (like SqlEntityManager). You can get around that by explicitly injecting via @Inject('EntityManager') em: SqlEntityManager (ideally we should register the flavour automatically).

Once v4 reaches RC (so basically once the huge PR gets merged), I will update the example projects with a migration PRs, hopefully this will come soon, maybe during next week.

@B4nan
Copy link
Collaborator

B4nan commented Jul 22, 2020

Here is the initial version: https://github.com/mikro-orm/nestjs

Not yet published, so for now you can inline the project manually. It does support v4, it also registers the EM flavours automatically, plus some other fixes (like support for forRoot() without param (which will take the CLI config automatically), as well as support for forFeature() with array of entities (not with object { entities: [...] }). Will publish it later this week.

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

No branches or pull requests

3 participants