Class: DataPlugin
A plugin for integrating Data persistence into the application.
Extends
Constructors
Constructor
new DataPlugin(
logger,injector):DataPlugin
Parameters
logger
Logger
injector
Injector
Returns
DataPlugin
Overrides
Properties
options
protectedoptions:DataPluginOptions
Overrides
state
protectedstate:PluginLifecycle
Inherited from
stateError?
protectedoptionalstateError?:Error
Inherited from
dependencies?
readonlystaticoptionaldependencies?: (PluginType<Plugin> | {optional:boolean;plugin:PluginType; })[]
Inherited from
Methods
getState()
getState():
PluginLifecycle
Retrieves the current lifecycle state of the plugin.
Returns
The current lifecycle state of the plugin.
Inherited from
getStateError()
getStateError():
Error|undefined
Retrieves the error state of the plugin, if any.
Returns
Error | undefined
The error that caused the plugin to enter the error state, or undefined if no error occurred.
Inherited from
onRegister()
onRegister(
context,options?):Promise<void>
Initializes data sources and registers each decorated repository with the application container.
Parameters
context
Application context whose container receives the data sources and repositories.
options?
Data plugin configuration with one or more named TypeORM sources.
Returns
Promise<void>
Overrides
onStart()
onStart():
Promise<void>
Logs that the Data plugin has started.
Returns
Promise<void>
Overrides
onStop()
onStop():
Promise<void>
Closes every TypeORM data source created by this plugin.
Returns
Promise<void>
Overrides
setState()
setState(
state):void
Sets the lifecycle state of the plugin.
Parameters
state
The new lifecycle state of the plugin.
Returns
void
Inherited from
setStateError()
setStateError(
error):void
Sets the error state of the plugin.
Parameters
error
Error
The error that caused the plugin to enter the error state.
Returns
void