Skip to main content
Version: Next

Timestamps

Timestamps can be used to automatically set the created_at and updated_at fields on your entities.

Timestamps are enabled by default

Configuration

To disable timestamps, you need to set the autoTimestamp field to false in configuration file:

{
...
"db": {
"connectionString": "postgres://postgres:[email protected]/postgres",
"autoTimestamp": false
}
...
}

Customizing the field names

By default, the created_at and updated_at fields are used. You can customize the field names by setting the createdAt and updatedAt options in autoTimestamp field in configuration file:

{
...
"db": {
"connectionString": "postgres://postgres:[email protected]/postgres",
"autoTimestamp": {
"createdAt": "inserted_at",
"updatedAt": "updated_at"
}
...
}