Skip to content

Shorthand form of foreign key constraint prevents editing in Grid view #5379

@norstbox

Description

@norstbox

Summary

Shorthand form of foreign key constraint prevents FK editing in the "Data->Grid view" tab.
Under "shorthand form" I mean REFERENCES table instead of REFERENCES table(column)

Steps to reproduce

  • Create DB using the following SQL:
CREATE TABLE artist(
  artistid    INTEGER PRIMARY KEY, 
  artistname  TEXT
);
CREATE TABLE track(
  trackid     INTEGER,
  trackname   TEXT, 
  trackartist INTEGER REFERENCES artist
);

INSERT INTO artist (artistid, artistname) VALUES (1, 'Bob');
  • Insert row into track table via "Data->Grid view" tab.
  • Click on trackartist cell and try to type in or select value "1".

Expected outcome

Editing without issues.

Actual results

The following warning arise in the status: "Cannot edit this cell. Details: Error while executing SQL query on database 'test': no such column: artist."

Selecting a value is not possible because dropdown show nothing.
Manual entry is also not possible because the entered value is reset to NULL.

SQLiteStudio version

3.4.17

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions