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

Roadmap to 1.0.0 #101

Open
5 of 10 tasks
phortx opened this issue May 15, 2019 · 8 comments
Open
5 of 10 tasks

Roadmap to 1.0.0 #101

phortx opened this issue May 15, 2019 · 8 comments
Assignees
Milestone

Comments

@phortx
Copy link
Collaborator

phortx commented May 15, 2019

@phortx phortx added this to the 1.0.0 milestone May 15, 2019
@phortx phortx self-assigned this May 15, 2019
@phortx phortx pinned this issue May 15, 2019
@tonipepperoni
Copy link

regarding pagination you can maybe get around this by simply setting a model with an attribute which identifies it as a Paginator Model.

Then simply ORM create instead of ORM insert.

So you could do BlogPostPaginator.fetch()

this was a relatively easy solution for me and allowed me to maintain state of pagination of each model.

Regarding eager loading I found that there were a lot of problems automatically loading certain relations especially if certain relations are expensive by default.

Laravel's Eloquent ORM is really quite nice.

post->with(['comments.likes','comments.images'])->fetch()

We should be able to temporarily set eager relations using a with method - this would really be handy.

Pivoting is also very important and quite lacking.

I am solving some of these issues, I'll let u know if i come to any findings with my work.

@tonipepperoni
Copy link

A few other things.

  • should have a flag which simply does vuex orm .create() instead of a .insert() (would solve pagination)
  • should change schema so inputs are named more specifically e.g.:
    CreatePostInput
    UpdatePostInput

can be quite a problem when it's not separated out I feel. or maybe allow you to specify the input names for the above 2 crud operations.

@phortx
Copy link
Collaborator Author

phortx commented Jun 3, 2019

Thank you very much for your input @tonipepperoni ! :)

Regarding eager loading I found that there were a lot of problems automatically loading certain relations especially if certain relations are expensive by default.

Good point, maybe we should add a skipEagerLoading or something to make sure that stuff that is normally eagerly loaded (hasOne, belongsTo) are not loaded automatically. For expensive records this would help I think.

Laravel's Eloquent ORM is really quite nice.
post->with(['comments.likes','comments.images'])->fetch()
We should be able to temporarily set eager relations using a with method - this would really be handy.

a with (and without) option was one of the early ideas. We should revive this: #104

Pivoting is also very important and quite lacking.

What's the issue here? I mean what do you actually need, what doesn't work?

should have a flag which simply does vuex orm .create() instead of a .insert() (would solve pagination)

Using create() instead of insert() can cause issues. I currently don't remember what kind of issues, but I think it has something to do with IDs. I will investigate on this: #105

should change schema so inputs are named more specifically e.g.:
CreatePostInput
UpdatePostInput

You can do this via adapters.

@tonipepperoni
Copy link

Maybe the ideal option is in your is to have a connection setting which eagerloads such relations by default.

This issue with create and insert is probably because create only makes 1 vuex orm record, which is good for pagination, auth-user etc (singletons). but bad for multiple records.

I think having two separate actions is appropriate and worked well for me.

@phortx
Copy link
Collaborator Author

phortx commented Jun 3, 2019

I like the philosophy of hiding such complexity from the user. .fetch() should just work and one should not think about which kind of operation on the store is used.

I will check this when I have some time :) Thanks for your help.

@tonipepperoni
Copy link

for pivots -> refers to store models where the primary key is a combination of 2 foreign keys (usually)

@tonipepperoni
Copy link

@phortx maybe if you want it to be really simple then you could have a flag in the vuex-orm model itself like
createOnly = true;

but I think the problem is that in certain cases you would want it to create and other times you'd want it to insert.

@Stefano1990
Copy link

Subscriptions are not on the list so I guess they won't make it into 1.0.0? I can't find any infos regarding PRs related to subscriptions either?

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

3 participants