Skip to content
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

track data type dependencies #376

Open
agentm opened this issue Oct 18, 2024 · 0 comments
Open

track data type dependencies #376

agentm opened this issue Oct 18, 2024 · 0 comments
Assignees

Comments

@agentm
Copy link
Owner

agentm commented Oct 18, 2024

Removing a data type from the db context can invalidate a relvar's consistency.

TutorialD (master/main): data HairColor = Brown | Black | Red | Blond
TutorialD (master/main): salon_customer := relation{tuple{name "Bob", hair Brown}, tuple{name "Steve", hair Blond}}
TutorialD (master/main): undata HairColor
TutorialD (master/main): :showexpr salon_customer
ERR: NoSuchDataConstructorError "Brown"

We should prevent the deletion of a type which is in use in a relvar or any functions. They will need to be redefined.
In the future, we should define which alterations to a type are "safe" for existing data- for example, adding a value constructor to an existing data type should be safe for relvars, but could create unmatched pattern errors in database functions. Perhaps there is no safe way to alter database types.

@agentm agentm self-assigned this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant