jeremydaly / data-api-client

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

Fix Date type support when using Aurora PostgreSQL #109

Closed mikkom closed 2 years ago

mikkom commented 2 years ago

This change fixes the deserializeDate format option functionality when using Aurora PostgreSQL. From there the type names arrive in lowercase and you also have the timestamptz abbreviation for timestamp with time zone.

calvin-cdev commented 2 years ago

@jeremydaly i was just looking at this and you merged it while i was reading :laughing: thanks for this package!!

calvin-cdev commented 2 years ago

@jeremydaly it looks like when you merged main into this before merging the pr, you dropped the typeName.toUpperCase() change. I can confirm that with the postgres data-api, the cast to upper case is necessary for the formatRecordValue function to have any effect. I put a log line in the function, console.log(typeName), and all the logs are showing typeName as lowercase.

jeremydaly commented 2 years ago

Thanks @calvin-summer. I'm getting ready to publish two new versions, one with a few fixes to v1.x and then v2.0 with the AWS SDK v3 support. I'll look at this as well.

calvin-cdev commented 2 years ago

@jeremydaly I just brought this up in an issue with the orm driver package that I use (which uses your data-api-client). I wasn't sure if this should be fixed here or in consumers, although I suspect it should be fixed here, since one would expect the pg engine option to be fully compatible. I'd be happy to open a PR later with the change.

jeremydaly commented 2 years ago

That'd be great. Please PR against the aws-sdk-v3-migration branch as v1 will be deprecated soon.

calvin-cdev commented 2 years ago

@jeremydaly opened a pr #117