@istock/iswork / Exports / RepositoryManager
Class: RepositoryManager
仓库管理
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new RepositoryManager(dataSource
): RepositoryManager
Parameters
Name | Type |
---|---|
dataSource | DataSource <TDataSourceType > |
Returns
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
Name | Type |
---|---|
model | typeof BaseModel |
createDatas | TIdAnyObject [] |
Returns
Promise
<(string
| number
)[]>
Defined in
src/packages/iswork/src/orm/repository/repository-manager.ts:45
delete
▸ delete(model
, query
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
model | typeof BaseModel |
query | TOrmQuery |
Returns
Promise
<boolean
>
Defined in
src/packages/iswork/src/orm/repository/repository-manager.ts:57
getRepository
▸ getRepository(target
): Repository
根据模型获取仓库,给数据源使用,仓管管理和数据源一对一绑定
Parameters
Name | Type |
---|---|
target | typeof BaseModel |
Returns
Defined in
src/packages/iswork/src/orm/repository/repository-manager.ts:28
query
▸ query<Result
>(model
, query
): Promise
<Result
[]>
Type parameters
Name | Type |
---|---|
Result | unknown |
Parameters
Name | Type |
---|---|
model | typeof BaseModel |
query | TOrmQuery |
Returns
Promise
<Result
[]>
Defined in
src/packages/iswork/src/orm/repository/repository-manager.ts:41
run
▸ run<Result
>(model
, ...executeArgs
): Promise
<Result
>
Type parameters
Name | Type |
---|---|
Result | unknown |
Parameters
Name | Type |
---|---|
model | typeof BaseModel |
...executeArgs | unknown [] |
Returns
Promise
<Result
>
Defined in
src/packages/iswork/src/orm/repository/repository-manager.ts:37
update
▸ update(model
, updateData
, query
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
model | typeof BaseModel |
updateData | TAnyObj |
query | TOrmQuery |
Returns
Promise
<boolean
>
Defined in
src/packages/iswork/src/orm/repository/repository-manager.ts:49
updateMany
▸ updateMany(model
, updateDataList
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
model | typeof BaseModel |
updateDataList | TAnyObj [] |
Returns
Promise
<boolean
>
Defined in
src/packages/iswork/src/orm/repository/repository-manager.ts:53