jeremydaly / data-api-client

A "DocumentClient" for the Amazon Aurora Serverless Data API
MIT License
444 stars 63 forks source link

fix(pg): handle pg engine lowercase typeName #117

Open calvin-cdev opened 2 years ago

calvin-cdev commented 2 years ago

aurora serverless with postgresql returns typeName as lowercase. because of this, the function formatRecordValue does not function properly for pg responses.

to fix, I cast the typeName to uppercase at the start of the function, storing it in a new const standardizedTypeName. added a test case to cover this issue.

calvin-cdev commented 2 years ago

@jeremydaly any chance you'd be okay with me rebasing this onto main so we can get it in? i'm currently having to write custom logic to resolve generated date strings into date objects and i'd rather have the driver do it as expected.