MySQL has auto_increment
which allows us to create unique primary keys automatically.
However, this only works for integer columns. There doesn't seem to be a way to combine auto_increment
with binary
columns, for example:
mysql > create table Users(Id binary(6) auto_increment, primary key(id));
#1063 - Incorrect column specifier for column 'Id'
How can we create or implement an auto-increment binary column?
(Finding a solution which maintains atomicity and have comparable performance to auto_increment
integer columns.)