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): introduce ORM extensions #3773

Merged
merged 1 commit into from
Nov 18, 2022
Merged

feat(core): introduce ORM extensions #3773

merged 1 commit into from
Nov 18, 2022

Conversation

B4nan
Copy link
Member

@B4nan B4nan commented Nov 18, 2022

Register your extensions in the ORM config this way:

import { defineConfig } from '@mikro-orm/postgres';
import { Migrator } from '@mikro-orm/migrations';
import { EntityGenerator } from '@mikro-orm/entity-generator';
import { SeedManager } from '@mikro-orm/seeder';

export default defineConfig({
  dbName: 'test',
  extensions: [Migrator, EntityGenerator, SeedManager],
});

This will replace the static requires we use for extensions like entity generator or seeder in v6 (right now they are still there as a fallback to the extension).

Related: #3743

@B4nan B4nan force-pushed the extensions branch 4 times, most recently from 02cda18 to 0981089 Compare November 18, 2022 15:24
@B4nan B4nan marked this pull request as ready for review November 18, 2022 15:26
Register your extensions in the ORM config this way:

```ts
import { defineConfig } from '@mikro-orm/postgres';
import { Migrator } from '@mikro-orm/migrations';
import { EntityGenerator } from '@mikro-orm/entity-generator';
import { SeedManager } from '@mikro-orm/seeder';

export default defineConfig({
  dbName: 'test',
  extensions: [Migrator, EntityGenerator, SeedManager], // those would have a static `register` method
});
```

This will replace the static requires we use for extensions like entity generator or seeder.

Related: #3743
@B4nan B4nan merged commit 0f36967 into master Nov 18, 2022
@B4nan B4nan deleted the extensions branch November 18, 2022 16:34
@B4nan B4nan restored the extensions branch January 10, 2023 19:11
@B4nan B4nan deleted the extensions branch January 10, 2023 19:17
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.

1 participant