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
{{ message }}
Repository navigation
[Bug]: Cannot add data to a table which exists #4169
I have an issue where I can create new rows for some tables using slqitebrowser but it does not work for others.
I used sqlitebrowser to add records to a table called Competency using SQL from within sqlitebrowser. I added a record to the User table using the GUI.
I want to add a new row to a table called Evidence and it will use records from the tables mentioned previously as foreign keys.
Check that the table exists using select * from sqlite_schema;.
DB4S has a very weird quirk when it comes to the GUI and creating foreign references. I'll have to post a youtube video. I did post this in an earlier issue, but its probably long since died.
The short version is that DB4S has mangled the foreign key reference for you.
CONSTRAINT "Competency_Id_FK" FOREIGN KEY("Competency_Id") REFERENCES "",
The other constraint is correct - 'REFERENCES "Competency"("Id")'
The references bit is blank.
I can't easily explain the GUI thing, but in a video its a quick thing where you'll go, 'oh for f.... sake.....' and it'll work.
Alternatively, drop the contraint in SQL and add it manually.
I set the database up a while ago and I do recall finding setting up the foreign key constraints a little challenging. I've fixed the Reference of the foreign key and it not works.
Activity
FriedrichFroebel commentedon Aug 1, 2026
Could you please provide the full steps to reproduce this issue from scratch?
chrisjlocke commentedon Aug 1, 2026
DB4S has a very weird quirk when it comes to the GUI and creating foreign references. I'll have to post a youtube video. I did post this in an earlier issue, but its probably long since died.
The short version is that DB4S has mangled the foreign key reference for you.
CONSTRAINT "Competency_Id_FK" FOREIGN KEY("Competency_Id") REFERENCES "",
The other constraint is correct - 'REFERENCES "Competency"("Id")'
The references bit is blank.
I can't easily explain the GUI thing, but in a video its a quick thing where you'll go, 'oh for f.... sake.....' and it'll work.
Alternatively, drop the contraint in SQL and add it manually.
I'll post the video later....
RichyL commentedon Aug 2, 2026
I set the database up a while ago and I do recall finding setting up the foreign key constraints a little challenging. I've fixed the Reference of the foreign key and it not works.
Thank you very much.
chrisjlocke commentedon Aug 2, 2026
Not or now? ;)
RichyL commentedon Aug 2, 2026
Sorry. It now works that I've fixed the reference in the foreign key constraint.