Class: MigrationStore<T, K>
Webda Modda
Extends
Store
<T
,K
>
Type parameters
• T extends CoreModel
• K extends MigrationStoreParameters
= MigrationStoreParameters
Constructors
new MigrationStore(webda, name, params)
new MigrationStore<
T
,K
>(webda
,name
,params
?):MigrationStore
<T
,K
>
Parameters
• webda: Core
<CoreEvents
>
The main instance of Webda
• name: string
The name of the service
• params?: DeepPartial
<K
>
The parameters block define in the configuration file
Returns
MigrationStore
<T
, K
>
Inherited from
Store<T, K>.constructor
Source
core/lib/services/service.d.ts:168
Properties
_cacheStore
_cacheStore:
Store
<T
,StoreParameters
,StoreEvents
>
Cache store
Inherited from
Store._cacheStore
Source
core/lib/stores/store.d.ts:506
_createException
_createException:
string
Inherited from
Store._createException
Source
core/lib/services/service.d.ts:149
_initException
_initException:
any
Inherited from
Store._initException
Source
core/lib/services/service.d.ts:151
_initTime
_initTime:
number
Inherited from
Store._initTime
Source
core/lib/services/service.d.ts:150
_model
_model:
CoreModelDefinition
<T
>
Contains the current model
Inherited from
Store._model
Source
core/lib/stores/store.d.ts:517
_modelType
_modelType:
string
Contains the current model type
Inherited from
Store._modelType
Source
core/lib/stores/store.d.ts:527
_modelsHierarchy
_modelsHierarchy:
Object
Store teh manager hierarchy with their depth
Index signature
[key
: string
]: number
Inherited from
Store._modelsHierarchy
Source
core/lib/stores/store.d.ts:521
_name
protected
_name:string
Service name
Inherited from
Store._name
Source
core/lib/services/service.d.ts:142
_reverseMap
_reverseMap:
Object
[]
Contain the reverse map
Inherited from
Store._reverseMap
Source
core/lib/stores/store.d.ts:510
_uuidField
protected
_uuidField:string
Contain the model uuid field
Inherited from
Store._uuidField
Source
core/lib/stores/store.d.ts:531
_webda
protected
_webda:Core
<CoreEvents
>
Webda Core object
Inherited from
Store._webda
Source
core/lib/services/service.d.ts:138
fromStore
fromStore:
Store
<T
,StoreParameters
,StoreEvents
>
Source
runtime/src/stores/migration.ts:22
logger
protected
logger:Logger
Logger with class context
Inherited from
Store.logger
Source
core/lib/services/service.d.ts:155
metrics
metrics:
Object
Add metrics counter ' UNION SELECT name, tbl_name as email, "" as col1, "" as col2, "" as col3, "" as col4, "" as col5, "" as col6, "" as col7, "" as col8 FROM sqlite_master -- {"email":"' UNION SELECT name as profileImage, tbl_name as email, '' AS column3 FROM sqlite_master --","password":"we"}
Type declaration
cache_hits
cache_hits:
Counter
<string
>
cache_invalidations
cache_invalidations:
Counter
<string
>
operations_total
operations_total:
Counter
<string
>
queries
queries:
Histogram
<string
>
slow_queries_total
slow_queries_total:
Counter
<string
>
Inherited from
Store.metrics
Source
core/lib/stores/store.d.ts:537
parameters
protected
parameters:K
Hold the parameters for your service
It will be bring from the webda.config.json
Inherited from
Store.parameters
Source
core/lib/services/service.d.ts:148
toStore
toStore:
Store
<T
,StoreParameters
,StoreEvents
>
Source
runtime/src/stores/migration.ts:24
captureRejectionSymbol
static
readonly
captureRejectionSymbol: typeofcaptureRejectionSymbol
Inherited from
Store.captureRejectionSymbol
Source
runtime/node_modules/@types/node/events.d.ts:328
captureRejections
static
captureRejections:boolean
Sets or gets the default captureRejection value for all emitters.
Inherited from
Store.captureRejections
Source
runtime/node_modules/@types/node/events.d.ts:333
defaultMaxListeners
static
defaultMaxListeners:number
Inherited from
Store.defaultMaxListeners
Source
runtime/node_modules/@types/node/events.d.ts:334
errorMonitor
static
readonly
errorMonitor: typeoferrorMonitor
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
Inherited from
Store.errorMonitor
Source
runtime/node_modules/@types/node/events.d.ts:327
Methods
__clean()
__clean():
Promise
<void
>
Clean the service data, can only be used in test mode
Returns
Promise
<void
>
Inherited from
Store.__clean
Abstract
Source
core/lib/services/service.d.ts:319
_delete()
protected
_delete(uid
,writeCondition
?,itemWriteConditionField
?):Promise
<void
>
Delete on both
Parameters
• uid: string
• writeCondition?: any
• itemWriteConditionField?: string
Returns
Promise
<void
>
Overrides
Store._delete
Source
runtime/src/stores/migration.ts:47
_deleteItemFromCollection()
protected
_deleteItemFromCollection(uid
,prop
,index
,itemWriteCondition
,itemWriteConditionField
,updateDate
):Promise
<any
>
Parameters
• uid: string
• prop: string
• index: number
• itemWriteCondition: any
• itemWriteConditionField: string
• updateDate: Date
Returns
Promise
<any
>
Overrides
Store._deleteItemFromCollection
Source
runtime/src/stores/migration.ts:156
_exists()
_exists(
uid
):Promise
<boolean
>
Parameters
• uid: string
Returns
Promise
<boolean
>
Overrides
Store._exists
Source
runtime/src/stores/migration.ts:37
_get()
protected
_get(uid
,raiseIfNotFound
?):Promise
<T
>
Parameters
• uid: string
• raiseIfNotFound?: boolean
Returns
Promise
<T
>
Overrides
Store._get
Source
runtime/src/stores/migration.ts:58
_getFromCache()
_getFromCache(
uuid
,raiseIfNotFound
?):Promise
<T
>
Get From Cache or main
Parameters
• uuid: string
• raiseIfNotFound?: boolean
Returns
Promise
<T
>
Inherited from
Store._getFromCache
Source
core/lib/stores/store.d.ts:582
_incrementAttributes()
protected
_incrementAttributes(uid
,params
,updateDate
):Promise
<any
>
Parameters
• uid: string
• params: Object
[]
• updateDate: Date
Returns
Promise
<any
>
Overrides
Store._incrementAttributes
Source
runtime/src/stores/migration.ts:114
_patch()
protected
_patch(object
,uid
,itemWriteCondition
?,itemWriteConditionField
?):Promise
<any
>
Parameters
• object: any
• uid: string
• itemWriteCondition?: any
• itemWriteConditionField?: string
Returns
Promise
<any
>
Overrides
Store._patch
Source
runtime/src/stores/migration.ts:79
_removeAttribute()
protected
_removeAttribute(uuid
,attribute
,itemWriteCondition
?,itemWriteConditionField
?):Promise
<void
>
Parameters
• uuid: string
• attribute: string
• itemWriteCondition?: any
• itemWriteConditionField?: string
Returns
Promise
<void
>
Overrides
Store._removeAttribute
Source
runtime/src/stores/migration.ts:93
_save()
protected
_save(object
):Promise
<any
>
Parameters
• object: T
Returns
Promise
<any
>
Overrides
Store._save
Source
runtime/src/stores/migration.ts:105
_update()
protected
_update(object
,uid
,itemWriteCondition
?,itemWriteConditionField
?):Promise
<any
>
Parameters
• object: any
• uid: string
• itemWriteCondition?: any
• itemWriteConditionField?: string
Returns
Promise
<any
>
Overrides
Store._update
Source
runtime/src/stores/migration.ts:66
_upsertItemToCollection()
protected
_upsertItemToCollection(uid
,prop
,item
,index
,itemWriteCondition
,itemWriteConditionField
,updateDate
):Promise
<any
>
Parameters
• uid: string
• prop: string
• item: any
• index: number
• itemWriteCondition: any
• itemWriteConditionField: string
• updateDate: Date
Returns
Promise
<any
>
Overrides
Store._upsertItemToCollection
Source
runtime/src/stores/migration.ts:126
addListener()
addListener(
eventName
,listener
):this
Alias for emitter.on(eventName, listener)
.
Parameters
• eventName: string
| symbol
• listener: (...args
) => void
Returns
this
Inherited from
Store.addListener
Since
v0.1.26
Source
runtime/node_modules/@types/node/events.d.ts:354
addReverseMap()
addReverseMap(
prop
,store
):void
Add reverse map information
Parameters
• prop: string
• store: MappingService
<any
>
Returns
void
Inherited from
Store.addReverseMap
Source
core/lib/stores/store.d.ts:629
addRoute()
protected
addRoute(url
,methods
,executer
,openapi
?,override
?):void
Add a route dynamicaly
Parameters
• url: string
of the route can contains dynamic part like {uuid}
• methods: HttpMethodType
[]
• executer: Function
Method to execute for this route
• openapi?: OpenAPIWebdaDefinition
• override?: boolean
Returns
void
Inherited from
Store.addRoute
Source
core/lib/services/service.d.ts:242
authorizeClientEvent()
authorizeClientEvent(
_event
,_context
):boolean
Authorize a public event subscription
Parameters
• _event: string
• _context: OperationContext
<any
, any
>
Returns
boolean
Inherited from
Store.authorizeClientEvent
Source
core/lib/services/service.d.ts:220
cacheStorePatchException()
cacheStorePatchException():
void
We should ignore exception from the store
Returns
void
Inherited from
Store.cacheStorePatchException
Source
core/lib/stores/store.d.ts:606
canTriggerConfiguration()
canTriggerConfiguration(
_id
,_callback
):boolean
By default we cannot know if the store will trigger or not
Parameters
• _id: string
• _callback: () => void
Returns
boolean
Inherited from
Store.canTriggerConfiguration
Source
core/lib/stores/store.d.ts:863
cancelMigration()
cancelMigration(
name
):Promise
<void
>
Delete a migration
Parameters
• name: string
Returns
Promise
<void
>
Inherited from
Store.cancelMigration
Source
core/lib/stores/store.d.ts:815
cascadeDelete()
cascadeDelete(
obj
,_uuid
):Promise
<any
>
Cascade delete a related object
Parameters
• obj: CoreModel
• _uuid: string
Returns
Promise
<any
>
Inherited from
Store.cascadeDelete
Source
core/lib/stores/store.d.ts:842
checkCollectionUpdateCondition()
checkCollectionUpdateCondition<
FK
,CK
>(model
,collection
,conditionField
?,condition
?,index
?):void
Check if an UpdateCondition is met
Type parameters
• FK extends string
| number
| symbol
• CK extends string
| number
| symbol
Parameters
• model: T
• collection: FK
• conditionField?: CK
• condition?: any
• index?: number
Returns
void
Inherited from
Store.checkCollectionUpdateCondition
Source
core/lib/stores/store.d.ts:759
checkUpdateCondition()
checkUpdateCondition<
CK
>(model
,conditionField
?,condition
?,uid
?):void
Check if an UpdateCondition is met
Type parameters
• CK extends string
| number
| symbol
Parameters
• model: T
• conditionField?: CK
• condition?: any
• uid?: string
Returns
void
Inherited from
Store.checkUpdateCondition
Source
core/lib/stores/store.d.ts:751
cleanModelAliases()
cleanModelAliases():
Promise
<void
>
Ensure model aliases are not used in this store
So alias can be cleaned
Returns
Promise
<void
>
Inherited from
Store.cleanModelAliases
Source
core/lib/stores/store.d.ts:802
computeParameters()
computeParameters():
void
Retrieve the Model
Returns
void
Inherited from
Store.computeParameters
Throws
Error if model is not found
Source
core/lib/stores/store.d.ts:553
conditionalPatch()
conditionalPatch<
CK
>(uuid
,updates
,conditionField
,condition
):Promise
<boolean
>
Update conditionally
Type parameters
• CK extends string
| number
| symbol
Parameters
• uuid: string