Unable to use Insert() on table without PK. #341
-
I have a table with no primary key. Bob does not generate setter interface for this table. create table distance (
source_id uuid not null,
date date not null,
distance bigint not null,
foreign key (source_id) references public.source (uuid)
); I can add a primary key to this table, but i wonder if this behavior is correct. |
Beta Was this translation helpful? Give feedback.
Answered by
stephenafamo
Jan 14, 2025
Replies: 1 comment
-
If a table does not have a primary key, it is treated as a "view" While If it si not too much trouble, I think it is easiest to add a primary key to the table |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
VRmnv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If a table does not have a primary key, it is treated as a "view"
While
INSERT
would be harmless,UPDATE
andDELETE
cannot work without a primary key.At the moment, there is no way to allow INSERT without also allowing UPDATE and DELETE, so this is how it is currently designed.
If it si not too much trouble, I think it is easiest to add a primary key to the table