How to add current timestamp in SQL? #3049
-
I have this table
But my when Drift parse |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
sqlite only supports a few column types and has special rules on how type names are mapped to them, which drift is following too. There is no builtin date time in sqlite3, you'd instead use Inside of drift files, you can use the special |
Beta Was this translation helpful? Give feedback.
-
@simolus3 The date is being created as the following: |
Beta Was this translation helpful? Give feedback.
sqlite only supports a few column types and has special rules on how type names are mapped to them, which drift is following too. There is no builtin date time in sqlite3, you'd instead use
TEXT
for that.Inside of drift files, you can use the special
DATETIME
type name to indicate that the column stores date time values as described here. Drift will then create the column asTEXT
orINTEGER
depending on how you want drift to store date times. I suggest enabling thestore_date_time_values_as_text
builder option as described in that link, then you can useCURRENT_TIMESTAMP
as a default value.