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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ULID with arbitrary timestamp #351

Open
borgoat opened this issue Feb 13, 2024 · 0 comments
Open

Support for ULID with arbitrary timestamp #351

borgoat opened this issue Feb 13, 2024 · 0 comments
Labels
feature-request New feature or request

Comments

@borgoat
Copy link

borgoat commented Feb 13, 2024

A very common use case we have in our Dynamo Table are ULIDs used as sort keys: not only does this make it trivial to get the most recent items, but it can also very easily be used to query items by arbitrary date ranges. Except this now requires a Lambda to compute a ULID at the specific timestamp(s) we need in our query,1 to compute the key condition expression.

Would it be reasonable to extend $util.autoUlid2 to accept a timestamp parameter, or alternatively add another built-in function to compute such ULIDs?

Footnotes

  1. https://github.com/ulid/javascript?tab=readme-ov-file#seed-time

  2. https://docs.aws.amazon.com/appsync/latest/devguide/built-in-util-js.html#utility-helpers-in-id-gen-js

@onlybakam onlybakam added the feature-request New feature or request label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants