Support for Row Deletion Policy #302
Labels
api: spanner
Issues related to the googleapis/python-spanner-sqlalchemy API.
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
We have a use case where some entities have a life cycle where they are created, kept alive through a polling mechanism, and then destroyed. In order to handle the case where the client fails to explicitly destroy an entity (through error, network failure, etc.), we have implemented a time-to-live feature that flags entities as stale once they have not received a keep-alive request beyond a certain delay. We currently have a scheduled event that calls a process to remove these stale entities.
Describe the solution you'd like
Cloud Spanner supports Row Deletion policies that would let us set the TTL directly in Spanner, without having to manage a scheduled process to do so. This requires adding SQL statements to the table declaration. We would like to be able to add these statements through the declarative
__table_args__
field of our SQLAlchemy models, much like interleaving.Describe alternatives you've considered
We can continue to run our scheduled process, but we would prefer to leverage the full capabilities of Spanner going forward.
Additional context
None.
The text was updated successfully, but these errors were encountered: