Refactor/module layout 2018#79
Open
seuros wants to merge 3 commits into
Open
Conversation
antejavor
reviewed
Jun 24, 2026
antejavor
left a comment
Collaborator
There was a problem hiding this comment.
Hmm I thought this would be just a structure change, but there are two things I am noticing.
- Introduced envs
- Changing the param type
Will take a deeper look into this tomorrow and push it over the line.
|
|
||
| fn execute_query_and_fetchall(query: &str) -> Vec<Record> { | ||
| let connect_prms = ConnectParams { | ||
| address: Some(String::from("127.0.0.1")), |
Collaborator
There was a problem hiding this comment.
We are changing the address to a host here. Looks ok, probably string vs numeric value. CI does not complain.
| /// (host/port default to `127.0.0.1:7687`, credentials unset). | ||
| fn test_params() -> ConnectParams { | ||
| ConnectParams { | ||
| host: Some(std::env::var("MGHOST").unwrap_or_else(|_| "127.0.0.1".to_string())), |
Collaborator
There was a problem hiding this comment.
We are introducing envs here. 🤔 We should probably used some more standard names for this, will link it.
Contributor
Author
There was a problem hiding this comment.
The Envs are introduced in tests only.
That allows me to run it again a remote mg instance.
The whole PR is just mechanical changes, i will open another change once this lands.
- connection: extract query_error/fail_query, settled_status, release_connection, optional_cstring, and fetch_records helpers; collapse repeated error/status handling and merge identical fetchone tail arms - value: add value_or_null + wrap_or_null! to dedup QueryParam conversion, and drop redundant no-op null guards in the *_to_mg_* converters - fix clippy: collapsible_match/if, while-let loop, .first(), is_some_and, size_of_val, OpenOptions::truncate
…PASSWORD Defaults preserved (127.0.0.1/localhost:7687, no credentials) so existing behavior is unchanged; lets the suite target an authenticated instance.
a61aa6c to
c7a26b5
Compare
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
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.
ping @antejavor
Just structure hygiene i had locally, nothing was changed here.