Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Create a guide for many to many relationships #51

Closed
ekryski opened this issue Mar 9, 2016 · 13 comments
Closed

Create a guide for many to many relationships #51

ekryski opened this issue Mar 9, 2016 · 13 comments
Assignees
Milestone

Comments

@ekryski
Copy link
Member

ekryski commented Mar 9, 2016

This keeps coming up over and over again and we need to have a concrete example we can point to for how you deal with many to many relationships with Feathers. We do have some stuff in the FAQ but I think we need a real guide.

Some related discussions to go off of:

@niallobrien
Copy link

What's the preferred method?

@ekryski
Copy link
Member Author

ekryski commented Apr 22, 2016

@niallobrien I'm pushing something up today

@niallobrien
Copy link

Awesome, thanks.

@ekryski ekryski self-assigned this Apr 24, 2016
@sscaff1
Copy link

sscaff1 commented Jul 21, 2016

Any updates on this?

@ekryski
Copy link
Member Author

ekryski commented Jul 26, 2016

@sscaff1 yes sorry I have some stuff in the works, basically if you need simple population you can just use the feathers populate hook and if you need more complex stuff you currently need to drop into sequelize by passing hook.params.sequelize options. If you search the github issues for the feathers org a bunch of stuff should come up.

I've been bogged down with work and we're not using sequelize so I'm hoping to have this guide wrapped up next week.

@ekryski ekryski modified the milestone: 2.0 Oct 17, 2016
@lobosan
Copy link

lobosan commented Feb 21, 2017

Hi @ekryski, hope you are doing well. I was wondering if the guide is ready? if so where can I find it? and if not, then can you say when this would be available? Thanks for your help.

@ekryski
Copy link
Member Author

ekryski commented Apr 14, 2017

I'm not sure if this is required any more since the new generator/cli v2.0.0, sets up the sequelize model structure for you automatically and you simply defined your many-to-many relationships the way sequelize tells you to.

The one thing might be related to population. @DesignByOnyx you wouldn't be up for writing a blog post would you? That way we can stop answering questions in Slack and just point people to the post.

@ekryski ekryski removed the Backlog label Apr 14, 2017
@DesignByOnyx
Copy link
Contributor

I certainly don't mind writing a blog post regarding population. You are correct that the new generators make it easy to define relationships. However, the "populate" hook is still broken with sequelize and there is some work which being done to fix that (read here. I am also working on a sequelize "include" hook which can be used by sequelize users to take advantage of SQL joins.

@eddyystop
Copy link
Contributor

@DesignByOnyx have you spoken to @daffl about having instantiate and serialize hooks in feathers-sequelize? That way we can get feathersjs-ecosystem/feathers-hooks-common#144 (comment) moving along.

@daffl
Copy link
Member

daffl commented Jan 9, 2018

This is now out of scope for the documentation. The database adapters document how to integrate with the ORM of choice. Blog posts are always welcome of course.

@daffl daffl closed this as completed Jan 9, 2018
@delebash
Copy link

According to the docs the preferred way is without using the orm adapters. As outlined here. The only example is the chat application but further examples and explanation of the proper way to use hooks to create relationships would be helpful such as a simple userrole or three table one to many and many to many example using the cli as the starting point would be appreciated. Thanks.

@edwardsmarkf
Copy link
Contributor

edwardsmarkf commented Jan 21, 2019 via email

@delebash
Copy link

delebash commented Jan 21, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants