Support DEFAULT
value / auto-UUID
column in CREATE
(similar to SERIAL
)
#3125
Replies: 2 comments
-
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.
-
It would be great, if we could declare within
CREATE
/DDL, that ids of aUUID
column are to be auto-created viagen_random_uuid()
. This feature would be analogue toSERIAL
for integer sequences.Currently Kuzu provides
gen_random_uuid()
for UUIDv4 auto-creation. But the need to invoke this function manually for new nodes withUUID
primary key is inconvenient and sometimes not easily possible - as seen withMERGE
in #3014. Actually I think proposal here is more useful than linked one.PostgreSQL provides
DEFAULT
value keyword withinCREATE
in 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
UUID
s.Beta Was this translation helpful? Give feedback.
All reactions