Database Manager - Allow for different Primary Key type (UUID)

Due to the distributed nature of the app I’m building (part desktop and part server) I need to use UUID’s for all records. Currently, the Database Manager automatically creates every table with an auto-increment ID field. I want to switch this to UUIDs instead.

If would be great if there was a way to specify it during creation or globally for all tables.

This would be good. I’ve just implemented UUID’s in a separate field and create this on user registration but see value in having an option for this as the default.

The problem is really relevant when you start to create “reference” fields in the Database Manager. It automatically selects the ID field since it’s set as the PK and there’s no way to switch the PK to another field from within the Database Manager, so even if you add it as a separate field it’s not super helpful.

3 Likes

Bumping this. Not being able to use uuid as the primary key was a surprise when setting up my db.

Hi Keith
This article describes in some detail the problems that arise if you make the uuid the primary key: https://www.percona.com/blog/2019/11/22/uuids-are-popular-but-bad-for-performance-lets-discuss/

If the use of uuid is necessary, it is best to make a separate field in the table, and leave the primary key as an auto-increment by default.

Implemented in Wappler 5.4