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

Define adapter type maps statically when possible #2199

Merged

Conversation

yahonda
Copy link
Collaborator

@yahonda yahonda commented Jul 29, 2021

This pull request supports Define adapter type maps statically when possible rails/rails#42773 in Active Record Oracle enhanced adapter.

Also, to make CI green this pull request needs these additional commits.

  • Use Oracle Instant Client 21.4
  • Rename _quote to quote
  • Rename _type_cast to type_cast

@yahonda
Copy link
Collaborator Author

yahonda commented Nov 29, 2021

rails/rails@c5bf2b4 support is necessary.

@yahonda yahonda force-pushed the define_adapter_type_maps_statically_when_possible branch from bce16be to dc51934 Compare November 30, 2021 11:44
@yahonda
Copy link
Collaborator Author

yahonda commented Nov 30, 2021

Now CI is green. Let me squash commits and make this pull request 'Ready for review.'

@yahonda yahonda force-pushed the define_adapter_type_maps_statically_when_possible branch 2 times, most recently from a18905d to 0b3099b Compare November 30, 2021 13:31
@yahonda yahonda force-pushed the define_adapter_type_maps_statically_when_possible branch from 0b3099b to a19175a Compare November 30, 2021 13:33
@yahonda yahonda force-pushed the define_adapter_type_maps_statically_when_possible branch from a19175a to 05090c8 Compare November 30, 2021 13:42
@yahonda yahonda marked this pull request as ready for review November 30, 2021 13:44
@yahonda yahonda requested a review from koic November 30, 2021 13:44
@yahonda
Copy link
Collaborator Author

yahonda commented Nov 30, 2021

I meant to say the main differences are adding TYPE_MAP constant and type_map method.

Copy link
Collaborator

@koic koic left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for tackling this!

@yahonda yahonda merged commit 293c24b into rsim:master Dec 1, 2021
@yahonda
Copy link
Collaborator Author

yahonda commented Dec 1, 2021

Thanks for the review. It gets merged.

@yahonda yahonda deleted the define_adapter_type_maps_statically_when_possible branch February 23, 2022 14:08
@andynu andynu mentioned this pull request Jun 15, 2022
@andynu andynu mentioned this pull request Jul 4, 2022
andynu added a commit to andynu/oracle-enhanced that referenced this pull request Jul 5, 2022
This appears to fix issue rsim#2256. I believe it should have the same memory implications as the intention in rsim#2199. The type maps are loaded once when they are first called. Only one instance of the mapping is ever created.

Fortunately this was enough to solve the problem, but if there were a need, this could easily be worked into the clear_cache! API to reset it at a later point in the application just by setting the @type_map to nil.
@andynu andynu mentioned this pull request Jul 5, 2022
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.

2 participants