Team,
During today’s product meeting we decided to work on improving Mathesar’s support for various PK configurations as part of 0.2.2. After the meeting, I spent a little time thinking this through, in an effort to move this initiative forward.
Here’s what I would suggest:
Allow customizing the PK options when creating tables from Mathesar
Possible new functionality:
Possible entry points:
Relevant threads: discussion, issue
Improve support for manually-generated PKs
Improve support for the UUID type
Fix sequence setup in our sample data (so users don’t encounter this bug)
I think we need clarity on scope first. Perhaps we could get that async, if people can respond to this email. But if people don’t respond (or if we have differing opinions), then I think a meeting would be wise. I would suggest we don’t wait a whole week (until the next product meeting) to get this figured out. I think we can and should move faster, which is why I’ve tried to jump start this discussion via email.
Once we have clarity on scope, we need to identify the work that requires design. In my proposal, I think only the first bullet point above would require design (custom PK options for Mathesar-created tables). Even if the team does need to discuss scope, I still think it’s pretty likely that we’ll want to tackle this feature. So this brings me to the biggest reason I’m sending this email:
If we can get enough clarity on scope asynchronously, then Ghislaine could potentially get started designing the custom-PK-options feature soon. That would seem useful to me since I hear she needs work.
Those seem a bit contradictory to me
Oh, good catch! Let’s take “create table with no PK” out of scope then.
Excellent thoughts, Brent! My responses below:
Issue search
did you do a thorough search through our issues for “primary key”, “pkey”, “pk”, etc.?
Yeah, reasonably thorough. I could have missed some, but I’m fairly confident that I surfaced the important ones.
Import flow
You make some good points about the import flow which I hadn’t considered.
I think if we really stepped back and considered our ideal import flow along with all the pk-related features we’d want, it would certainly be too hefty for us to implement now. The good news is that I can think of a lot of different ways to strike a compromise. But the bad news is that all those different scope-cutting strategies lead to a somewhat open-ended problem with the risk of our team getting stuck in a design quagmire. We’ll need to carefully balance technical limitations with UX considerations, and I think we’ll have an easier time doing that on a call. I have some creative ideas to add to the mix, but for the sake of efficiency I’ll save them for the call.
The table import flow is where I think we need to focus our synchronous discussion efforts.
I would hope that we can (roughly) spec out much of the surrounding work asynchronously.
Default values
I suggest we restrict the scope to either “use Mathesar’s auto-generated integer ID, Mathesar’s auto-generated UUID id, or manually enter pkey values into any type pkey column you’d like” for this release.
Yeah, this sounds good to me.
Sequences
The sequence setup bug in our sample data is already fixed in this PR
Ahh, right. Thanks. Let’s strike that from the list then!
Non-PK tables
Regarding supporting preexisting tables without primary keys, I think it would be nice to at least smooth out the error experience without actually increasing any functionality for these tables.
Gosh, yeah you’re right — the experience is quite bad currently! I just opened this issue to track that: Provide better error experience for tables without primary keys. And yeah, I agree it’d be easy to do, so we ought to take this up for 0.2.2.
Adding a primary key column
Neat idea. I would suggest we roll this idea into the design discussion for the import flow, since I imagine the two would be related.
Removing multi-column PKs
Yeah, this makes sense. And I imagine it would be covered under Allow users to add and remove primary key constraints.