now() generates a TIMEUUID from the current time and the hardware MAC address. Because TIMEUUID values encode timestamps, they can order records by creation time. section 4.4.1
Use now() when inserting a row whose primary key is a TIMEUUID. It avoids manually creating the identifier, but the application cannot know the generated key until it reads the row. section 4.4.1 section 6.1.1
Insert an author
An authors table can use a TIMEUUID primary key. Insert an author with `INSERT INTO authors(id, name) VALUES (now(), 'Alice Author');`. If the generated ID must be reused immediately, generate the TIMEUUID externally instead. section 6.1.1
cqlsh: types> INSERT INTO basic(text, uuid, timeuuid)
VALUES ('uuids', uuid(), now());
Try now() alongside uuid() in cqlsh to compare a random UUID with a time-based UUID. section 4.4.1
ScyllaDB can convert the resulting TIMEUUID back into a readable timestamp with toTimestamp(timeuuid), making the encoded time visible in query results. section 4.4.1
