Class AbstractEntityManager<MongoDBDatasources, KnexDataSources, Scalars, MetadataType>Abstract
Type Parameters
-
MongoDBDatasources extends string
-
KnexDataSources extends string
-
-
MetadataType = unknown
Constructors
constructor
- new AbstractEntityManager<MongoDBDatasources, KnexDataSources, Scalars, MetadataType>(args: {
cache?: {
engine: TypettaCache;
};
idGenerators?: { [ K in string | number | symbol]?: (() => Scalars[K]) };
metadata?: MetadataType;
scalars?: DriverDataTypeAdapterMap<Scalars>;
}): AbstractEntityManager<MongoDBDatasources, KnexDataSources, Scalars, MetadataType>
-
Type Parameters
-
MongoDBDatasources extends string
-
KnexDataSources extends string
-
-
MetadataType = unknown
Parameters
-
args: {
cache?: {
engine: TypettaCache;
};
idGenerators?: { [ K in string | number | symbol]?: (() => Scalars[K]) };
metadata?: MetadataType;
scalars?: DriverDataTypeAdapterMap<Scalars>;
}
-
Optional
cache?: {
engine: TypettaCache;
}
-
Optional
idGenerators?: { [ K in string | number | symbol]?: (() => Scalars[K]) }
-
Optional
metadata?: MetadataType
-
Returns AbstractEntityManager<MongoDBDatasources, KnexDataSources, Scalars, MetadataType>
Properties
Transaction
Transaction
: AbstractEntityManager<MongoDBDatasources, KnexDataSources, Scalars, MetadataType> & { __transaction_enabled__
: true; } = ...
Optional
metadata
metadata?: MetadataType
Methods
dao
- dao(daoName: string): AbstractDAO<DAOGenerics<any, any, any, any, any, any, any, any, any, any, any, any, any, AbstractEntityManager<string, string, any, any>>>
-
Returns AbstractDAO<DAOGenerics<any, any, any, any, any, any, any, any, any, any, any, any, any, AbstractEntityManager<string, string, any, any>>>
Abstract
execQuery
- execQuery<T>(run: ((dbs: Record<string, unknown>, entities: Record<string, unknown>) => Promise<T>)): Promise<T>
-
Parameters
-
run: ((dbs: Record<string, unknown>, entities: Record<string, unknown>) => Promise<T>)
-
- (dbs: Record<string, unknown>, entities: Record<string, unknown>): Promise<T>
-
Parameters
-
dbs: Record<string, unknown>
-
entities: Record<string, unknown>
Returns Promise<T>
Returns Promise<T>
getKenxTransaction
- getKenxTransaction(datasource: string): undefined | Transaction<any, any[]>
-
Returns undefined | Transaction<any, any[]>
getMongoSession
- getMongoSession(datasource: string): undefined | ClientSession
-
Returns undefined | ClientSession
isTransacting
- isTransacting(): boolean
-
Returns boolean
transaction
- transaction<T>(transaction: TransactionData<MongoDBDatasources, KnexDataSources>, f: ((dao: AbstractEntityManager<MongoDBDatasources, KnexDataSources, Scalars, MetadataType> & {
__transaction_enabled__: true;
}) => Promise<T>)): Promise<T>
-
Parameters
-
transaction: TransactionData<MongoDBDatasources, KnexDataSources>
-
f: ((dao: AbstractEntityManager<MongoDBDatasources, KnexDataSources, Scalars, MetadataType> & {
__transaction_enabled__: true;
}) => Promise<T>)
-
- (dao: AbstractEntityManager<MongoDBDatasources, KnexDataSources, Scalars, MetadataType> & {
__transaction_enabled__: true;
}): Promise<T>
-
Parameters
-
dao: AbstractEntityManager<MongoDBDatasources, KnexDataSources, Scalars, MetadataType> & {
__transaction_enabled__: true;
}
Returns Promise<T>
Returns Promise<T>