agentm / agentm/project-m36

implement deferred constraints

Aperta
#310 7 commenti 0 reazioni 1 assegnatario Rivendicata da @agentm Vedi su GitHub
Lingua principale
Haskell
Stelle
952
Fork
50
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Discussed in https://github.com/agentm/project-m36/discussions/307

Originally posted by **farzadbekran** October 19, 2021
I was thinking it might be a good idea to have some way to delay constraint checks until `commit`. Here is an example scenario:

Imagine I have RelVar `a` and `b`, now RelVar `b` has an attribute that is foreign key from `a`. Now if I want to make a change to the attributes of `a`, I need to `undefine` `a`, make changes to the attribs and update the tuples accordingly and redefine it. But since `b` depends on `a` existing, this fails as I can't simply `undefine` `a`, which means I have to `undefine` constaints for `b` to be able to change `a`, and if we have a RelVar `c` which depends on `b`, we have a nightmare on our hands! I assume the is no easy way to determine what constraints reference `a`, so that it can be somewhat automated or something.

But if I can disable constraint checks temporarily, I can make my changes to `a` without having to `undefine` constraints for `b` and `c` in the process. Hope this makes sense!

This would come in handy specially if I need to make a quick change in production.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.