Support DEFAULT value / auto-UUID column in CREATE (similar to SERIAL)
#3125
Replies: 3 comments 2 replies
-
|
I think this is a really good idea, and I'm also wondering if it makes sense to have an alternative option to auto-create a unique integer primary key (something like UINT128, kind of what Neo4j does) instead of a UUID in cases where a simple serial integer works. From a user perspective, this is something that commonly is a source of annoyance: having to create a primary key manually for cases where the raw data doesn't have it. But I'll leave it to @ray6080 and @andyfengHKU to discuss on any potential implementation challenges for this. |
Beta Was this translation helpful? Give feedback.
-
|
See #3238 |
Beta Was this translation helpful? Give feedback.
-
|
I want this. This is an obvious feature :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be great, if we could declare within
CREATE/DDL, that ids of aUUIDcolumn are to be auto-created viagen_random_uuid(). This feature would be analogue toSERIALfor integer sequences.Currently Kuzu provides
gen_random_uuid()for UUIDv4 auto-creation. But the need to invoke this function manually for new nodes withUUIDprimary key is inconvenient and sometimes not easily possible - as seen withMERGEin #3014. Actually I think proposal here is more useful than linked one.PostgreSQL provides
DEFAULTvalue keyword withinCREATEin combination with equally namedgen_random_uuid()for these cases (more examples in 1, 2):or with directly prepended
PRIMARY KEY:, requested for Kuzu in #2911.
I think this would be a nice addition to usability of
UUIDs.Beta Was this translation helpful? Give feedback.
All reactions