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

ModelId - Manipulate data without loading #21

Open
2 tasks
stombre opened this issue Sep 26, 2020 · 0 comments
Open
2 tasks

ModelId - Manipulate data without loading #21

stombre opened this issue Sep 26, 2020 · 0 comments
Labels
available for contribution If you search issue, you could contribute in enhancement New feature or request good first issue Good for newcomers

Comments

@stombre
Copy link
Contributor

stombre commented Sep 26, 2020

Model.id allow user to create a reference with a model instance, without loading it.

We could introduce method to manipulate this reference;

const MY_REF = Model.id(ID)

await MY_REF.delete();

// Similar as;
const instance = await Model.query()
  .id.is(ID)
  .findOne();

await instance.delete();

Add;

  • ModelId.query(): Create a query targeting directly the associate instance
  • ModelId.delete(): Auto delete associate instance (shortcut for ModelId.query().deleteOne())
@stombre stombre added enhancement New feature or request good first issue Good for newcomers available for contribution If you search issue, you could contribute in labels Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available for contribution If you search issue, you could contribute in enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant