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

Discussion: How to structure linked columns? #121

Open
timwis opened this issue Jul 10, 2017 · 0 comments
Open

Discussion: How to structure linked columns? #121

timwis opened this issue Jul 10, 2017 · 0 comments

Comments

@timwis
Copy link
Owner

timwis commented Jul 10, 2017

Originally from #1:

We want users to be able to associate a record in one table with a record in another table. Fieldbook takes the approach of always making this relationship many-to-many. My assumption is because that relationship is easiest for less technical users to understand: records are simply "associated" with one another, so why shouldn't a post have more than one user associated with it?

If many-to-many meets the most use cases then I think we should build for that. The question is whether there's a use case that many-to-many can't accommodate?

As far as how to accomplish this, one way (perhaps the only) is to have a joins table with left and right fields containing the record ids. Although what if you want your posts table to have an author field and an editor field, both linking to the users table? We'd need to associate the joins table records with a particular relationship, requiring a relationships table. Too complex?

On the other hand, we want dataface to resemble typical postgres databases, so supporting a basic foreign key constraint would be ideal from that perspective.

Either way, we'll want to know which column from the foreign table to use as the "display field" (instead of the primary key, which is likely an auto-incrementing number). We can store this in the column COMMENT.

@timwis timwis added this to the Linked columns milestone Jul 10, 2017
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

1 participant