Table primary key removed when query is updated

  1. My goal:
    Occasionally, new columns need to be added to the query which is set as the data source for a table component. This should have no affect on the table except for the new column being added.

  2. Issue:
    When a new column is added to the query, the primary key field is removed from the table as soon as the query is saved and run. Even if the new column is added to the end of the query. This is done almost silently as there is no warning and the user does not notice unless they are watching for it.

Based on the releases compare code, the primary key field is using an ID for the column that should be the primary key. When the desired primary key is manually picked again, that line of the code is no longer marked as a change. This makes me think Retool should be able to keep this column selected.

  1. Steps I've taken to troubleshoot:
    This appears to only take place when a column is added as an ' Columns automatically updated' function is automatically called. Removing columns has no affect on the primary key.
1 Like

I've also found this "feature" a bit irritating.

I'm working a lot with developing the tables and every now an again I notice "Primary key" has a small red triangle and realise I must have missed to set it again after adding a column.

2 Likes

Hi there,

Thank you both for the feedback! I agree, it would be very helpful to lock the primary key.

We have a request for this in our backlog. Unfortunately, it isn't currently being prioritized over other projects, but I'll reach out here if that changes

+1

I’m also experiencing this issue. Additionally, any time the refresh button is pressed, the value resets to empty. This has caused several problems since there’s no warning or indication, it often gets missed, and users are then unable to run updates on tables. This behavior seems like a bug and should be prioritized for a fix.

1 Like