Skip to content

Conversation

@skyrpex
Copy link
Contributor

@skyrpex skyrpex commented Jun 3, 2025

Currently, the toJsonObject method from rds only supports { stringValue: string }, but other value types can appear in payloads, such as { longValue: number }, { doubleValue: number }, etc. See https://docs.aws.amazon.com/rdsdataservice/latest/APIReference/API_Field.html for more information.

This PR changes toJsonObject so it extracts the values properly. It also uses the row label if available, and the row name as a fallback.

@skyrpex skyrpex marked this pull request as ready for review June 3, 2025 16:19
@skyrpex skyrpex requested a review from simonrw June 3, 2025 16:19
Currently, the `toJsonObject` method from `rds` only supports `{ stringValue: string }`, but other value types can appear in payloads, such as `{ longValue: int }`.

This PR changes it so it assumes value types of any kind, as long as the value type is an object with a key and the value we want to map.
@skyrpex skyrpex force-pushed the fix-rds.toJsonObject branch from 7b72488 to e2141a3 Compare June 3, 2025 16:24
@skyrpex
Copy link
Contributor Author

skyrpex commented Jun 4, 2025

There are more data type which we don't still handle: see https://docs.aws.amazon.com/rdsdataservice/latest/APIReference/API_Field.html.

I'll add support for those types as well.

@skyrpex skyrpex marked this pull request as draft June 4, 2025 08:37
@skyrpex skyrpex marked this pull request as ready for review June 4, 2025 09:24
Copy link
Collaborator

@simonrw simonrw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this funtionality!

@skyrpex skyrpex merged commit b952735 into main Jun 4, 2025
6 of 7 checks passed
@skyrpex skyrpex deleted the fix-rds.toJsonObject branch June 4, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants