@tsrt/typeorm-transactions
Version:
TypeORM convenient transactions management
16 lines (15 loc) • 861 B
TypeScript
import { Repository, ObjectLiteral, Connection } from 'typeorm';
import { AnyFunction } from './utils';
/**
* Patches provided class prototype `manager` property to try to use EntityManager form Cls Namespace, and fallback to default.
*
* @param repository - Repository class to be patched. @default require('typeorm').Repository. @example Repository || Repository.prototype.
* @param options - Optional options to be used for getting manager connection. Mostly you won't need it.
*/
export declare function patchTypeOrmRepository(repository?: AnyFunction | Object, options?: IPatchRepositoryOptions): void;
export interface IPatchRepositoryOptions {
connection?: Connection | AnyFunction<Connection>;
connectionName?: string | AnyFunction<string>;
}
export declare class BaseRepository<Entity extends ObjectLiteral> extends Repository<Entity> {
}