I'll add some
thoughts:
Nice doc, Pavish! Very well-structured and clearly written. I’m happy to see this sort of process in building a new feature.
The spec says:
Tables will contain the menu bar with options to filter, sort, and group.
What about explorations? Can we show the same filter/sort/group UI for those too, so that viewers can manipulate the results of an exploration?
Regarding the data model…
Here is a nice article which I’ve referenced in the past, and will reference here for the sake of discussion.
The article classifies Pavish’s original suggestion as “polymorphic joins” and mentions the downsides that it sounds like Brent also found concerning. I agree we should avoid it.
Brent’s counter proposal is similar to the “reverse belongs-to” approach, as classified by that article. However, in Brent’s proposal, there would not be a “public_links” model at all.
Brent’s proposal would seem fine to me if we had no intention of ever associating any extra settings with a public link. But our competitors do associate extra data with sharable links. For example Baserow lets you add a password to the link and Google Sheets lets you choose the level of access to grant to visitors. In the “Scheduled for later iterations” section of the spec, I can see that we already have our eye on building similar features, so I would suggest establishing a data model at the outset which is more amenable to extension.
The article concludes by recommending
“exclusive belongs-to”, which I think is worth considering
here. We would have a public_links
model, like Pavish recommended, but instead of having entity
and entity_id
,
it would have table_id
and exploration_id
,
along with an XOR-style CHECK constraint for integrity
purposes. What do you think about that, Brent and Pavish?
Looks good to me too.
My only (small) concern is that maybe we shouldn’t name the URL public_links
(we might want to use the same feature for password protected links, or whatnot, which aren’t “public” in the same way, and could lead to confusing mental models in the future). I’d consider something more generic like shares
instead of public_links
.
shares
instead of public_links