Skip to content

@istock/iswork / Exports / DataSource

Class: DataSource<Type>

Type parameters

NameType
Typeextends TDataSourceType

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new DataSource<Type>(options): DataSource<Type>

Type parameters

NameType
Typeextends TDataSourceType

Parameters

NameType
optionsTDataSourceAllOptions[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

NameType
modeltypeof 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

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