-
Notifications
You must be signed in to change notification settings - Fork 0
Gestione multi db #1
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have to review the core parts
src/DatabaseLibrary/assertion.py
Outdated
""" | ||
|
||
def check_if_exists_in_database(self, selectStatement, sansTran=False): | ||
def check_if_exists_in_database(self,alias, selectStatement, sansTran=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable some PEP8 plugin to remark missing or double spaces.
def check_if_exists_in_database(self,alias, selectStatement, sansTran=False): | |
def check_if_exists_in_database(self, alias, selectStatement, sansTran=False): |
def check_if_exists_in_database(self, selectStatement, sansTran=False): | ||
def check_if_exists_in_database(self,alias, selectStatement, sansTran=False): | ||
""" | ||
Check if any row would be returned by given the input `selectStatement`. If there are no results, then this will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd better have to document this change also because this is a breaking change that introduces a new mandatory field.
src/DatabaseLibrary/query.py
Outdated
return allRows | ||
return 'DONE',allRows | ||
except Exception as Err: | ||
logger.info('Error: %s' % Err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this way you won't stop execution but if an exception occurs during db connection I would not proceed in what am I doing.
Moreover it looks like an error probably should be
logger.info('Error: %s' % Err) | |
logger.error('Error: %s' % Err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case of connection problems, the exception is handled in the other class.
Modified the queries in this way, it is possible to manage even the negative tests, not only the positive ones, using robots through the status that is output.
raise AssertionError(err_msg) | ||
|
||
|
||
def connect_to_database_using_custom_params(self, alias, dbapiModuleName=None, db_connect_string=''): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the point of duplicating the method, logging can be added anyway in the called method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with only one connection there would be no need. With multiple connections I thought it was more correct to add to the error message also the name of the connection that produced it.
@@ -0,0 +1,3 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should be in .gitignore
No description provided.