You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEpost(
id integerprimary key,
title text
);
CREATETABLEtag(
id integerprimary key,
title text
);
CREATETABLEpost_tag(
post_id integerreferences post(id),
tag_id integerreferences tag(id),
primary key(post_id, tag_id)
);
Or:
CREATETABLEpost(
id integerprimary key,
title text
);
CREATETABLEpost_tag(
post_id integernot nullreferences post(id),
tag textnot null,
primary key(post_id, tag)
);
Is there a way this can fit into the editing model such that the user sees a list of tags when looking at /db/post/1 ?
The currently proposal would have the user go to /db/post to create the post, go to /db/tag to create the tags, then go to /db/post_tag and create new records. It works, but is very clunky.
The text was updated successfully, but these errors were encountered:
cldellow
changed the title
Is a good UI for join tables possible?
brainstorming: Is a good UI for join tables possible?
Feb 6, 2023
cldellow
changed the title
brainstorming: Is a good UI for join tables possible?
brainstorming: Is a good UI for editing join tables possible?
Feb 6, 2023
Proposal: special-case this scenario for base tables (but not views).
Render a UI that lets you add/delete tags. It will feel a little jarring, as it will get tacked on outside of the main table with the other controls. That's probably worth it.
Why not views: because the principle of views is that you explicitly opt some columns in. But currently, views have to draw from a single table to be editable.
Maybe long term we can expand VIEW support to recognize and permit things of the shape:
SELECT id, title agg(tag)
FROM post
LEFT JOIN post_tag ONpost.id=post_tag.post_idGROUP BY1, 2
Then we'd:
render an appropriate multi select UI
create appropriate INSTEAD OF triggers
Tedious, but not technically complicated. But also, no back compat challenges, so doesn't have to be part of v1
Imagine:
Or:
Is there a way this can fit into the editing model such that the user sees a list of tags when looking at
/db/post/1
?The currently proposal would have the user go to
/db/post
to create the post, go to/db/tag
to create the tags, then go to/db/post_tag
and create new records. It works, but is very clunky.The text was updated successfully, but these errors were encountered: