You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many RDBMs allow to initialize time-stamp columns with a default that is current time rather than some interpretation of 0 (e.g. epoch) or NULL.
Here is an example from MySQL: create table comment (comment varchar(512), ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
It would be very useful feature if added to the Kuzu's Cypher language. Something like: CREATE NODE TABLE IF NOT EXISTS File ( path STRING PRIMARY KEY, created_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
The text was updated successfully, but these errors were encountered:
hi @NatanPuzis
we already support making the current_timestamp as the default value. Instead of writing as CURRENT_TIMESTAMP, you have to write it as a function CURRENT_TIMESTAMP()
E.g.
Good to know! I think it is worth updating the site documentation to let the readers know that DEFAULTs, besides literal values, can be set to call a function.
API
Python
Description
Many RDBMs allow to initialize time-stamp columns with a default that is current time rather than some interpretation of 0 (e.g. epoch) or NULL.
Here is an example from MySQL:
create table comment (comment varchar(512), ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
It would be very useful feature if added to the Kuzu's Cypher language. Something like:
CREATE NODE TABLE IF NOT EXISTS File ( path STRING PRIMARY KEY, created_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
The text was updated successfully, but these errors were encountered: