Auto Increment field

I would like to be able to specify an id field as auto increment

2 Likes

+1, it’s the only missing essential feature for me to implement my SQL exports

Thanks for your request! Yes this is something we’re working on actually. I’d imagine when it is ready, the syntax would be like:

Table users {
  id integer [pk, increment]
  name varchar [not null]
}
2 Likes

Hi, it would also be great to have this using the Oracle/Postgres10+ syntax:

Table table_name {
    id int [pk, increment]
}

would yield (when exporting Postgres)

CREATE TABLE table_name (
    id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
);

Hi @Nspector @Striffly @MarcusCemes, I’m Jia Wen from the dbdiagram.io team.
We are happy to announce, we have launched our auto-increment syntax!

Table users {
  id integer [pk, increment]
  name varchar [not null]
}

For more details, do check out our Release Note: https://dbdiagram.noting.io/6vdh5j/support-auto-increment

1 Like