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

Add attributes to objects in runtime #10

Open
kondziu opened this issue Jul 14, 2021 · 0 comments
Open

Add attributes to objects in runtime #10

kondziu opened this issue Jul 14, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@kondziu
Copy link
Contributor

kondziu commented Jul 14, 2021

When executing a query, sometimes people want to calculate and add an attribute to the object. We should perhaps add a facility to do so. Objects and their existing attributes should ultimately remain read-only, so these would be volatile.

Perhaps we could add a map to each object that could be added to within the DSL.

Ideas:

database.projects().attach_attribute(Attribute("HasTorvalds"),  Contains(project::Authors, User::new("torvalds", "...@...")));
database.projects().attach_attribute(Attribute("HasTorvalds"), |project| project.users().iter().any(|user| /* .. */.));
@kondziu kondziu added the enhancement New feature or request label Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant