Emulate traditional id INT AUTO_INCREMENT
?
#5687
Unanswered
IngwiePhoenix
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to migrate some of my old MySQL data across, but it uses integers for references. So, kind of for a lark, I would love to emulate ongoing integer IDs. Using
DEFAULT
seems like a perfect bet:DEFINE FIELD id ON sometable TYPE int DEFAULT ...;
However, in order to do the +1, I would have to query all rows again, which feels extremely overhead-y:
...DEFAULT count(SELECT * FROM sometable);
Is there a more sensible way to do this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions