You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having some trouble placing a custom repository wiich would store data in a relational database which for the purposes of my system I have to keep updated the same way that I want to maintain the "mongo" repository updated, the best place for it to be set should be at the viewBuilder, using the callback?
Something like that?
module.exports=require('cqrs-eventdenormalizer').defineViewBuilder({name: 'itemCreated',id: 'payload.id'},function(data,vm,callback){// assync logic to record data elsewhere//updating mongo databasevm.set(data);recordOnRelationalDatabase(data).then(function(recordedData){//...returncallback();}),catch(function(err){callback(err)});});
The text was updated successfully, but these errors were encountered:
Heucles
changed the title
Create a custom repository to store data into the
Create a custom repository to store data into a relational database
Aug 6, 2017
vm.set is not updating the database ( still ), just the viewmodel object, the database is updated on commit internally.
Do you want to maintain two databases with exactly the same data ( RDBMS and NoSQL ), or just a RDBMS one?
For RDMS databases, one will have to write an own DB implementation for the wanted database like those here, for maintaining both you might want to write an implementation that does that internally, or run two denormalizers, one for each database ( again after having some RDBMS implementation ).
May I ask why would you want two databases with exactly the same viewmodel data, and why would you store such data in a relational database?
I am having some trouble placing a custom repository wiich would store data in a relational database which for the purposes of my system I have to keep updated the same way that I want to maintain the "mongo" repository updated, the best place for it to be set should be at the viewBuilder, using the callback?
Something like that?
The text was updated successfully, but these errors were encountered: