@Amontillado : You could only choose entries for this statement, if the driver doesn’t set the statements by default. If using MySQL/MariaDB and following the wizard for MySQL/MariaDB databases there won’t be any possibility to add this entry in Edit → Database → Advanced Settings
. If you try to connect to MySQL/MariaDB by ignoring the wizard and start with choosing JDBC instead you would find Edit → Database → Advanced Settings → Generated Values
. Here you could add ‘AUTO_INCREMENT’ for Auto-increment statement and mark Retrieve generated values.
If you are using PostgreSQL you couldn’t choose any entry for Generated Values
. GUI seems to offer automatic values, but it won’t work well. You have to set the AutoValue by SQL with a code like
CREATE TABLE "public"."Test" (
"ID" SERIAL PRIMARY KEY
);
through Tools → SQL
. For JDBC connection you could choose the field type “Serial” in the table editor and no entry should be set to Generated Values
.
SQLite works only with JDBC here. Generate values are the same like rowid here. You have only to set a field to primary key, which has field type Integer. It will be automatically filled by values, but this automatic values will only be shown in GUI after reloading the table. You could also set generated value through SQL directly:
CREATE TABLE "tbl_Personen" (
"ID" INTEGER PRIMARY KEY AUTOINCREMENT,
"Name" TEXT NOT NULL
);
This will increment automatically and will be shown in GUI. But it won’t work with Generated Values
, because the additional AUTOINCREMENT is needed after defining PRIMARY KEY. Such a code won’t be created by the table wizard.