Support for CockroachDB row-level TTL #13982
Labels
kind/feature
A request for a new feature.
status/has-stopgap
A stopgap for this functionality has been implemented.
team/psl-wg
team/schema
Issue for team Schema.
topic: cockroachdb
topic: database-functionality
Problem
The release of CockroachDB 22.1 included a preview of row-level TTL. Adding row-level TTL to a table involves setting storage parameters either on
CREATE
or after using anALTER TABLE
. There be a hidden column (crdb_internal_expiration
) that holds the date which will need to be accessible using the Prisma Client for queries. Is there anything that can be done to better expose this feature using Prisma?Suggested solution
It would be nice to have a way to set storage parameters using an
@@
command on the model similar to@@map
.Alternatives
I think currently we would have to apply the row-level TTL after running the migration manually or attempt to edit the generated SQL. We would also need to figure out how Prisma would handle the hidden column. Do we manually add the column to the model? Would it be able to see it which selecting? This is similar to the region column.
Additional context
This is an interesting feature that you usually only see in Document or NoSQL databases.
This feature will be GA until 22.2.
The text was updated successfully, but these errors were encountered: