Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
#17 Bring Instance execution
Browse files Browse the repository at this point in the history
  • Loading branch information
marcionemec-daitan committed Feb 20, 2024
1 parent a1ce125 commit b906631
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/module/database_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ def rollback(self):
""" Runs a SQL statement. """
self.conn.rollback()

def test_db_connection(database_config):
connection_string = format_connection_string(database_config)
def test_db_connection(self,database_config):
connection_string = self.format_connection_string(database_config)
engine = create_engine(connection_string)
conn = engine.connect().execution_options(autocommit=False)
result = conn.execute(database_config["test_query"])
return result

return result

def format_connection_string(self, database_config: str):
""" Formats the connection string based on the database type and the connection configuration. """
Expand Down

0 comments on commit b906631

Please sign in to comment.