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

Support required attributes #35

Open
loganmhb opened this issue Nov 5, 2018 · 0 comments
Open

Support required attributes #35

loganmhb opened this issue Nov 5, 2018 · 0 comments

Comments

@loganmhb
Copy link
Owner

loganmhb commented Nov 5, 2018

Datomic doesn't support requiring an entity to have attributes, but I think this could be a useful feature to help ensure data consistency. Probably the way this would work is to have a db:entityType attribute, and then provide a way to define entity types and declare the set of required attributes.

There might be other type-level assertions that could be useful to add as well. I think it's a good idea not to disallow attributes, however -- that would make the schema too inflexible and difficult to grow. I think there's an analogy here to how clojure.spec works, allowing you to specify required map keys but not disallow additional keys.

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