aws / aws-appsync-community

The AWS AppSync community
https://aws.amazon.com/appsync
Apache License 2.0
506 stars 32 forks source link

Support for ULID with arbitrary timestamp #351

Open borgoat opened 9 months ago

borgoat commented 9 months ago

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.autoUlid^2 to accept a timestamp parameter, or alternatively add another built-in function to compute such ULIDs?