@istock/iswork / Exports / DataSource
Class: DataSource<Type>
Type parameters
Name | Type |
---|---|
Type | extends TDataSourceType |
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new DataSource<Type
>(options
): DataSource
<Type
>
Type parameters
Name | Type |
---|---|
Type | extends TDataSourceType |
Parameters
Name | Type |
---|---|
options | TDataSourceAllOptions [Type ] |
Returns
DataSource
<Type
>
Defined in
src/packages/iswork/src/orm/data-source.ts:24
Properties
#driver
• Private
#driver: AbstractDriver
Defined in
src/packages/iswork/src/orm/data-source.ts:10
#isInitialized
• Private
#isInitialized: boolean
= false
Defined in
src/packages/iswork/src/orm/data-source.ts:8
#name
• Private
Readonly
#name: string
Defined in
src/packages/iswork/src/orm/data-source.ts:7
#options
• Private
Readonly
#options: TDataSourceAllOptions
[Type
]
Defined in
src/packages/iswork/src/orm/data-source.ts:9
#repositoryManager
• Private
#repositoryManager: RepositoryManager
Defined in
src/packages/iswork/src/orm/data-source.ts:11
Accessors
driver
• get
driver(): AbstractDriver
Returns
AbstractDriver
Defined in
src/packages/iswork/src/orm/data-source.ts:20
name
• get
name(): string
Returns
string
Defined in
src/packages/iswork/src/orm/data-source.ts:12
options
• get
options(): TDataSourceAllOptions
[Type
]
Returns
TDataSourceAllOptions
[Type
]
Defined in
src/packages/iswork/src/orm/data-source.ts:16
Methods
connect
▸ connect(): Promise
<DataSource
<Type
>>
Returns
Promise
<DataSource
<Type
>>
Defined in
src/packages/iswork/src/orm/data-source.ts:68
disconnect
▸ disconnect(): Promise
<void
>
Returns
Promise
<void
>
Defined in
src/packages/iswork/src/orm/data-source.ts:80
getRepository
▸ getRepository(model
): Promise
<Repository
>
暴露给基础模型使用的方法
Parameters
Name | Type |
---|---|
model | typeof BaseModel |
Returns
Promise
<Repository
>
Defined in
src/packages/iswork/src/orm/data-source.ts:34
initialize
▸ initialize(): Promise
<DataSource
<Type
>>
Returns
Promise
<DataSource
<Type
>>
Defined in
src/packages/iswork/src/orm/data-source.ts:51
reconnect
▸ reconnect(): Promise
<DataSource
<Type
>>
Returns
Promise
<DataSource
<Type
>>
Defined in
src/packages/iswork/src/orm/data-source.ts:73