-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triggers and materialised views using pub sub patterns #117
Comments
I noticed that support for composite keys and many to many relationships is requested in the issues list. I want to point out that materialised views can be used to replace the need for many to many relationships. I would be happy to help on the code for this but i am super curious if it's supported & appreciated first. |
I'm not sure I understand what you are asking for. May you please clarify what you want to achieve and what should be done? |
sorry. Here goes again This is a much better summary. So with SQL dbs you need to joins between tables to build larger views that use FK's between tables. For example say you have:
Books Table
PersonsBook Table
Well instead of managing the joins, you can generate triggers to do the same things.
Books Table
PersonsBook Table (Materialised Table View)
Why ?
|
Would it be possible to support this in a non dialect specific way.
The reason i ask this is that i often need to produce tables of data triggered from cha he's in rows in other tables.
This can be done without specific dB system dependencies by using hooks in the golang data access layer.
For example when an i settings or delete it update occurs on structs t type X, publish an event that holds the event type and structure. Other tables can then subscribe to the event type and update their table.
This needs to allow a transaction context too.
The pattern des ribed above allows lots of interesting use cases:
Cqrs style architectures.
Nosql database structure tire using a SQL database.
Emergent design patterns
The text was updated successfully, but these errors were encountered: