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

Create model subset #1

Closed
FCO opened this issue Aug 15, 2018 · 5 comments
Closed

Create model subset #1

FCO opened this issue Aug 15, 2018 · 5 comments
Labels
help wanted Extra attention is needed
Projects

Comments

@FCO
Copy link
Owner

FCO commented Aug 15, 2018

Something like:

Person.where({ .id > 30 }).subset: name;

And that would only select the name column and return a object with only the name attribute

@FCO
Copy link
Owner Author

FCO commented Aug 16, 2018

subset isn't a good name once already exists a subset in perl6 that does something completely different

@FCO FCO added this to To do in Red Aug 16, 2018
@FCO FCO added the help wanted Extra attention is needed label Aug 16, 2018
@FCO
Copy link
Owner Author

FCO commented Aug 16, 2018

Maybe select! Something like:

Red.select: Track.title.as(song), CD.title.as(album), Artist.name.as(artist);

@FCO
Copy link
Owner Author

FCO commented Aug 16, 2018

That could create and return a new anon model with those columns

@FCO
Copy link
Owner Author

FCO commented Aug 18, 2018

This anon model shouldn’t be a model, but should do the Red::Result role. Models should do that role too

@FCO
Copy link
Owner Author

FCO commented Jan 1, 2019

Person.grep({ .id > 30 }).map: *.name;

was what I was looking for

@FCO FCO closed this as completed Jan 1, 2019
Red automation moved this from To do to Done Jan 1, 2019
FCO pushed a commit that referenced this issue Sep 14, 2019
* Replace near-empty index with the introduction

* Add a draft for the first tutorial

* Small doc fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Red
  
Done
Development

No branches or pull requests

1 participant