local-data-api
local-data-api copied to clipboard
Support "formatRecordsAs" in ExecuteStatementRequest
The AWS SDK for the Data API supports a "formatRecordsAs" parameter on the ExecuteStatementCommand
object, with default value of "NONE" and possible value of "JSON".
See details at:
- https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html and
- https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html#data-api-json
If formatRecordsAs = 'JSON'
, then the result of ExecuteStatementCommand
includes a single (JSON-formatted) string in ExecuteStatementResponse.formattedRecords
.
It would be great to support this parameter in local development for ExecuteStatementCommand
(via updating ExecuteStatementRequest
and ExecuteStatementResponse
).
But also this library is great :). Thank you.
Hey @finnwiz, did you find a workaround for this?
More or less. Just returned ColumnMetadata
and interrogated the col.typeName
attribute as we looped over records (and columns) and decoded each result (including parsing columns of JSON type, for example). It's not perfect (and making the typing conventions robust across all use cases is probably horrible) but it worked for us.
Thanks for the response. I created a PR because it seems like we will use this feature a lot. I hope it gets merged.
Would be so sick to get this merged in 💪