-
Notifications
You must be signed in to change notification settings - Fork 26
Feature/unsafe queries / Bug Fix Losing Connection #48
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
Merged
pdphilip
merged 11 commits into
pdphilip:dev-main
from
UseTheFork:feature/unsafe-queries
Oct 17, 2024
Merged
Feature/unsafe queries / Bug Fix Losing Connection #48
pdphilip
merged 11 commits into
pdphilip:dev-main
from
UseTheFork:feature/unsafe-queries
Oct 17, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… option - Introduced `perform_unsafe_queries` and `insert_chunk_size` options in `Connection`. - Updated `Query\Builder` to use configurable `insert_chunk_size` for bulk inserts. - Adjusted test configuration to reflect new `insert_chunk_size` option.
… option - Introduced `perform_unsafe_queries` and `insert_chunk_size` options in `Connection`. - Updated `Query\Builder` to use configurable `insert_chunk_size` for bulk inserts. - Adjusted test configuration to reflect new `insert_chunk_size` option.
- Eliminated the unused `rebuildConnection` method. - Removed the redundant `rebuild` property from the Connection class. - Adjusted `getClient` to build the connection if the client is missing. - Deleted the call to `rebuildConnection` in the Bridge class. Because who needs another rebuild when you can just health-check? 🔧✨
…ce check - Introduced `LogicException` extending `LaravelElasticsearchException`. - Created base `LaravelElasticsearchException` for custom exceptions. - Updated `MissingOrderException` to extend `LaravelElasticsearchException`. - Enhanced `Connection` to throw `LogicException` when method does not exist in `Bridge`. Why throw shade when you can throw exceptions? 🌩️
|
Thanks @use-the-fork, will have a look here when I get a chance |
- Properties with getters are inline with other connection based options - Renamed perform_unsafe_queries to bypass_map_validation (sounds less ominous) - Added bypass to other map check queries
|
Hey @use-the-fork , thanks for putting this one together. It's been published in v4.5.0 Just note that I changed the option name from 'elasticsearch' => [
......
'options' => [
'bypass_map_validation' => env('ES_OPT_BYPASS_MAP_VALIDATION', false),
.....
],
.....
], |
|
@pdphilip yea that makes sence. Thanks for merging it in! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to add a new option to allow a developer to opt into using "unsafe_queries". Essentially It's supposed to skip mapping checks and avoid doing any elastic search calls Except for when getting database info.
This is mostly needed from a performance perspective.
I also am running into a weird issue where save and saveWithOutRefresh lose their connection and as a result throw an exception. I can't replicate it in tests just in my environment that uses a Cloud connection. As a result, I added safety measures to ensure a connection existed before building the bridge.