Skip to content

Commit

Permalink
chore: remove unused decorators
Browse files Browse the repository at this point in the history
Removed unused decorators
  • Loading branch information
Yaapa Hage committed Jul 8, 2020
1 parent 5e34792 commit f8e75e8
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions extensions/typeorm/src/typeorm.decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,9 @@
// License text available at https://opensource.org/licenses/MIT

import {Context, inject, Injection, ResolutionSession} from '@loopback/core';
import {QueryRunner} from 'typeorm';
import {TypeOrmBindings} from './typeorm.keys';

export namespace typeorm {
export function connection(connectionName?: string) {
return inject(
'',
{decorator: '@typeorm.connection'},
async (
ctx: Context,
injection: Readonly<Injection>,
session: ResolutionSession,
) => {
return getConnection(ctx, connectionName);
},
);
}

export function entityManager(
connectionName?: string,
queryRunner?: QueryRunner,
) {
return inject(
'',
{decorator: '@typeorm.entityManager'},
async (
ctx: Context,
injection: Readonly<Injection>,
session: ResolutionSession,
) => {
const conn = await getConnection(ctx, connectionName);
return conn.createEntityManager(queryRunner);
},
);
}

export function repository(entity: Function, connectionName?: string) {
return inject(
'',
Expand Down

0 comments on commit f8e75e8

Please sign in to comment.