Merged
Conversation
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
5 tasks
susodapop
approved these changes
Oct 4, 2023
susodapop
left a comment
There was a problem hiding this comment.
Very good PR description. I've evaluated each commit sequentially. I'm not super-familiar with Node best practices but nothing here sticks out as a bad pattern and the changes make sense. This is good to merge assuming existing tests pass.
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.
This library is designed so we have to initialize a root object (
DBSQLClient) which later produces many of other object which represent sessions, operations, results sets and so on. And most of those objects require some common stuff, for example - logger, driver, connection - which are created and owned by their parentDBSQLClientinstance. Previously we were passing those objects separately down the whole tree, and with time it became harder to add new items to that common context. In this PR, common objects are wrapped together into a context provider (implemented byDBSQLClient) which is then passed to all classes that need it.This PR is also a spin-off of #174 (#193) which itself is an example why these changes are needed. There we need to access a
HttpConnectioninstance owned byDBSQLClientinDBSQLSessionandCloudFetchResultwhich required to pass this object down the tree.Other use cases for this (not implemented in this PR, but planned for future) - add logging to classes which weren't capable to write to log until now (result handlers), and also move global config settings to context.
It may be easier to review changes commit by commit. Tests were just updated to match new signatures, without changes to their logic