Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Include expiresAt in Datastore to allow TTL #317

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gbowman85
Copy link

@gbowman85 gbowman85 commented Sep 4, 2022

Added expiresAt to the data stored. Value will be a date object of the creation time plus expirationMs. This will allow TTL in Datastore to be set.

P.S. This is my first pull request so please go easy on me :)

Fixes #314 馃

Added expiresAt to the data stored. Value will be a date object of the creation time plus expirationMs.
@gbowman85 gbowman85 requested review from a team as code owners September 4, 2022 23:59
@google-cla
Copy link

google-cla bot commented Sep 4, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: datastore Issues related to the googleapis/nodejs-datastore-session API. labels Sep 5, 2022
@gbowman85 gbowman85 changed the title Update index.ts Include expiresAt in Datastore to allow TTL Sep 5, 2022
@gbowman85 gbowman85 changed the title Include expiresAt in Datastore to allow TTL feat: Include expiresAt in Datastore to allow TTL Sep 7, 2022
@bcoe
Copy link
Contributor

bcoe commented Oct 17, 2022

@gbowman85 thank you for the contribution 馃憦

Reading the documentation linked in #314, it wasn't clear to me that setting expiresAt would set a TTL in datastore. Where is this functionality documented?

If we can set a TTL directly in datastore now, I think we could remove logic from this library that handles the TTL.

@gbowman85
Copy link
Author

@gbowman85 thank you for the contribution 馃憦

Reading the documentation linked in #314, it wasn't clear to me that setting expiresAt would set a TTL in datastore. Where is this functionality documented?

"expiresAt" is not a key term, I was just following the same format as was used in the library. A property of 'expiresAt' wouldn't automatically trigger a TTL, but it does allow you to create one using the method in the documentation: https://cloud.google.com/datastore/docs/ttl#create_ttl_policy

@gbowman85
Copy link
Author

Anything I can do to help move this forward? @bcoe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/nodejs-datastore-session API. size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request: TTL integration
2 participants