Loading src/common/mixins/postgres.py +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ class PostgresMixin: db_timeout = self.connection_info.get("dbTimeout", PostgresMixin.DEFAULT_TIMEOUT) self.logger.debug("Opening Database Connection and creating Cursor") self.logger.debug(self.connection_info) try: self.connection = psycopg2.connect( database=db_name, Loading src/common/mixins/sqlite.py +2 −2 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class SQLiteMixin: :return: True if connection established, else False """ db_name = self.connection_info.get("dbName", SQLiteMixin.DEFAULT_DB) self.logger.debug("Opening Database Connection") self.logger.debug(f"Opening Database Connection to {db_name}") try: self.connection = sqlite3.connect(db_name) self.connection.row_factory = ( Loading @@ -49,7 +49,7 @@ class SQLiteMixin: try: self.cursor.execute(query) if self.cursor.description is not None: return self.cursor.fetchall() return [dict(row) for row in self.cursor.fetchall()] return None except sqlite3.InterfaceError as error: self.logger.error(f"An unexpected InterfaceError occurred: {error}") Loading Loading
src/common/mixins/postgres.py +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ class PostgresMixin: db_timeout = self.connection_info.get("dbTimeout", PostgresMixin.DEFAULT_TIMEOUT) self.logger.debug("Opening Database Connection and creating Cursor") self.logger.debug(self.connection_info) try: self.connection = psycopg2.connect( database=db_name, Loading
src/common/mixins/sqlite.py +2 −2 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class SQLiteMixin: :return: True if connection established, else False """ db_name = self.connection_info.get("dbName", SQLiteMixin.DEFAULT_DB) self.logger.debug("Opening Database Connection") self.logger.debug(f"Opening Database Connection to {db_name}") try: self.connection = sqlite3.connect(db_name) self.connection.row_factory = ( Loading @@ -49,7 +49,7 @@ class SQLiteMixin: try: self.cursor.execute(query) if self.cursor.description is not None: return self.cursor.fetchall() return [dict(row) for row in self.cursor.fetchall()] return None except sqlite3.InterfaceError as error: self.logger.error(f"An unexpected InterfaceError occurred: {error}") Loading