-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mikro-orm): rename all occurrences of connection
closes #1741
- Loading branch information
Showing
17 changed files
with
182 additions
and
94 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
22 changes: 22 additions & 0 deletions
22
packages/orm/mikro-orm/src/decorators/entityManager.spec.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {DecoratorTypes, Store} from "@tsed/core"; | ||
import {Controller, INJECTABLE_PROP} from "@tsed/di"; | ||
import {EntityManager} from "@tsed/mikro-orm"; | ||
import {MongoEntityManager} from "@mikro-orm/mongodb"; | ||
|
||
@Controller("/users") | ||
export class UsersCtrl { | ||
@EntityManager() | ||
public readonly em!: MongoEntityManager; | ||
} | ||
|
||
describe("@Orm", () => { | ||
it("should decorate property", () => { | ||
expect(Store.from(UsersCtrl).get(INJECTABLE_PROP)).toEqual({ | ||
em: { | ||
propertyKey: "em", | ||
bindingType: DecoratorTypes.PROP, | ||
resolver: expect.any(Function) | ||
} | ||
}); | ||
}); | ||
}); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {DecoratorTypes, Store} from "@tsed/core"; | ||
import {Controller, INJECTABLE_PROP} from "@tsed/di"; | ||
import {Orm} from "@tsed/mikro-orm"; | ||
import {MikroORM} from "@mikro-orm/core"; | ||
|
||
@Controller("/users") | ||
export class UsersCtrl { | ||
@Orm() | ||
public readonly orm!: MikroORM; | ||
} | ||
|
||
describe("@Orm", () => { | ||
it("should decorate property", () => { | ||
expect(Store.from(UsersCtrl).get(INJECTABLE_PROP)).toEqual({ | ||
orm: { | ||
propertyKey: "orm", | ||
bindingType: DecoratorTypes.PROP, | ||
resolver: expect.any(Function) | ||
} | ||
}); | ||
}); | ||
}); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import {TransactionalInterceptor, TransactionOptions} from "../interceptors"; | ||
import {Intercept} from "@tsed/di"; | ||
|
||
export const Transactional = (connectionOrOptions?: string | TransactionOptions): MethodDecorator => | ||
Intercept(TransactionalInterceptor, connectionOrOptions); | ||
/** | ||
* Register a new request context for your method and execute it inside the context. | ||
* @param {String | TransactionOptions} contextNameOrOptions | ||
*/ | ||
export const Transactional = (contextNameOrOptions?: string | TransactionOptions): MethodDecorator => | ||
Intercept(TransactionalInterceptor, contextNameOrOptions); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.