2

I am trying to remove a record from sqlite database. I use dbeaver program for all operations. So when the action is performed, following error is shown:

enter image description here

enter image description here

The error says that unique key is not present. Query for table creation was this:

CREATE TABLE betGroups ( 
id INTEGER PRIMARY KEY AUTOINCREMENT, 
betgroupstatus INTEGER NOT NULL,
dateInserted DATETIME DEFAULT CURRENT_TIMESTAMP)

However, If we check the unique keys tab - we will see that a unique key is present:

enter image description here enter image description here

So basically, primary key IS considered a unique key. Nevertheless an error is still shown.

Is there a good explanation why I am getting this error? I tried adding a UNIQUE keyword for an id field. table was created, but it made no difference.. Is there anything else I can change either in program options or in SQL script in order for the error to go away.

I am not sure if this is my script issue, a driver issue, or a program issue.

Using:

  • org.sqlite.JDBC 3.28.0
  • dbeaver 6.1.1
halfer
  • 19,824
  • 17
  • 99
  • 186
Alex
  • 4,607
  • 9
  • 61
  • 99
  • Show how you're trying to delete rows? – Shawn Jul 21 '19 at 15:55
  • Selecting a row and pressing DELETE button on a keyboard. Then, on the bottom of the page you will see a `save` button (along with `cancel`). – Alex Jul 23 '19 at 06:51
  • So you're not manually entering a delete statement? It's an issue with that tool, then, not sqlite. – Shawn Jul 23 '19 at 13:31
  • @Shawn or my creation query is simply broken? But the comment is still valid.. The issue could be related to either. So I filed a bug to dbeaver as well. Let's see who responds faster :) https://github.com/dbeaver/dbeaver/issues/6337 – Alex Jul 24 '19 at 06:57

1 Answers1

1

It ended up to be a defect in DBeaver. Quote:

https://github.com/dbeaver/dbeaver/issues/6337

This is side effect of the #424 fix. Currently DBeaver doesn't use unique keys with nullable columns. I believe we should use them in SQLite at least.

Alex
  • 4,607
  • 9
  • 61
  • 99