Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(data-api): Introduced a new configuration option "formatOptions.… #7483

Merged
merged 1 commit into from
Mar 29, 2021
Merged

feat(data-api): Introduced a new configuration option "formatOptions.… #7483

merged 1 commit into from
Mar 29, 2021

Conversation

ArsenyYankovsky
Copy link
Contributor

@ArsenyYankovsky ArsenyYankovsky commented Mar 21, 2021

Description of change

Because the list of types supported by the Aurora Data API is limited Data API client introduced type casts. This pull request introduces a new configuration option for the Aurora drivers called castParameters that enables automatic casting based on the column types. To achieve this, TypeORM will delegate the preparePersistentValue operation to the driver package.

The same option will also delegate the prepareHydratedValue operation to unpack the Data API value types back to the TypeORM value types.

This pull request fixes existing issues for the following data types:

Besides fixing a bunch of existing bugs, moving this part of logic to the driver package will allow us to iterate and fix bugs in it faster as the release cycle there is shorter.

I also introduced new jobs in the driver CI workflows that test against a real server. Previously, this was tested against the local-data-api container which doesn't 100% reflect what real Data API does.

✔ A new version of the driver package for this change has already been released (2.0.0)

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

…castParameters" to delegate the prepare/hydrate parameters to the driver which will result in casting the parameters to their respective column type
@revmischa
Copy link

@ArsenyYankovsky A thousand blessings upon your soul for this fine work!

@carlocorradini
Copy link
Contributor

@ArsenyYankovsky Awesome!

@filipsuk
Copy link

This will be a game changer for our serverless stack. 🎉

@revmischa
Copy link

We're working on a template for serverless typescript applications leveraging this module: https://github.com/jetbridge/generator-jkv2
Based on React for frontend and Serverless with no framework on the backend

@pleerock pleerock merged commit 7793b3f into typeorm:master Mar 29, 2021
@pleerock
Copy link
Member

Thank you!

@pleerock
Copy link
Member

Hey @ArsenyYankovsky what do you think about adding something like https://github.com/koxudaxi/local-data-api/ to our test infrastructure in order to run tests of these changes in CI?

@ArsenyYankovsky
Copy link
Contributor Author

@pleerock Thanks for merging this. It is possible and would be nice to have tests pointing at the local data api. I have some tests pointing at the local data api in the driver repo as well as the tests pointing at the real data api.

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.

None yet

5 participants