excerpt from https://www.cockroachlabs.com/docs/serial.html:
We believe this data type is a better solution than PostgeSQL’s SERIAL and MySQL’s AUTO_INCREMENT types, both of which auto-increment integers but not necessarily in a strictly sequential fashion (see the Auto-Incrementing Is Not Always Sequential example below). However, if you find that this feature is incompatible with your application, please open an issue or chat with us on Gitter.
i have been using auto-generated keys for too long to turn back now. and cockroach SERIAL PRIMARY KEY approach is the best i have ever seen.
is it possible to somehow define the SERIAL PRIMARY KEY as a string rather than as an integer somehow? i did see a SMALLSERIAL option, but according to the documentation (and yes i actually looked at it) but it appears to be just a mere alias for SERIAL.
EDIT: is it possible to somehow shrink the size of the primary key by a mere one digit, from 18 digits to 17 digits? that would get me around the jS issue.
var xx = '23576496766323916';
parseInt(xx) // 23576496766323916