Skip to content

@istock/iswork / Exports / RepositoryManager

Class: RepositoryManager

仓库管理

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new RepositoryManager(dataSource): RepositoryManager

Parameters

NameType
dataSourceDataSource<TDataSourceType>

Returns

RepositoryManager

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:20

Properties

#dataSource

Private Readonly #dataSource: DataSource<TDataSourceType>

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:10


#repositoryMap

Private Readonly #repositoryMap: Map<typeof BaseModel, Repository>

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:9

Accessors

connector

get connector(): unknown

Returns

unknown

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:11


runner

get runner(): AbstractRunner<unknown>

Returns

AbstractRunner<unknown>

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:15

Methods

create

create(model, createDatas): Promise<(string | number)[]>

Parameters

NameType
modeltypeof BaseModel
createDatasTIdAnyObject[]

Returns

Promise<(string | number)[]>

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:45


delete

delete(model, query): Promise<boolean>

Parameters

NameType
modeltypeof BaseModel
queryTOrmQuery

Returns

Promise<boolean>

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:57


getRepository

getRepository(target): Repository

根据模型获取仓库,给数据源使用,仓管管理和数据源一对一绑定

Parameters

NameType
targettypeof BaseModel

Returns

Repository

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:28


query

query<Result>(model, query): Promise<Result[]>

Type parameters

NameType
Resultunknown

Parameters

NameType
modeltypeof BaseModel
queryTOrmQuery

Returns

Promise<Result[]>

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:41


run

run<Result>(model, ...executeArgs): Promise<Result>

Type parameters

NameType
Resultunknown

Parameters

NameType
modeltypeof BaseModel
...executeArgsunknown[]

Returns

Promise<Result>

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:37


update

update(model, updateData, query): Promise<boolean>

Parameters

NameType
modeltypeof BaseModel
updateDataTAnyObj
queryTOrmQuery

Returns

Promise<boolean>

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:49


updateMany

updateMany(model, updateDataList): Promise<boolean>

Parameters

NameType
modeltypeof BaseModel
updateDataListTAnyObj[]

Returns

Promise<boolean>

Defined in

src/packages/iswork/src/orm/repository/repository-manager.ts:53

免责声明:本站所有信息、数据、软件仅供学习研究,都不构成投资建议,本站不承担由此导致的任何责任。