From 5bb921095fe24a22e26dedfbf3b18c18bdcc1fa9 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 29 Apr 2023 22:27:08 +0000 Subject: [PATCH 1/2] Update to ibm_db_sa and test against SAMPLE database --- tap_db2/__init__.py | 2 +- tap_db2/connection.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tap_db2/__init__.py b/tap_db2/__init__.py index 6e4089c..2da6938 100644 --- a/tap_db2/__init__.py +++ b/tap_db2/__init__.py @@ -318,7 +318,7 @@ def discover_catalog(db2_conn, config): SYSCAT.TABLES t LEFT JOIN SYSCAT.COLUMNS c - ON c.TABNAME = t.TABNAME + ON (c.TABNAME = t.TABNAME or C.TABNAME = t.BASE_TABNAME) AND c.TABSCHEMA = t.TABSCHEMA WHERE t.TABSCHEMA NOT LIKE 'SYS%' ORDER BY t.TABSCHEMA,t.TABNAME,c.COLNO; diff --git a/tap_db2/connection.py b/tap_db2/connection.py index eade246..3a41c45 100644 --- a/tap_db2/connection.py +++ b/tap_db2/connection.py @@ -60,7 +60,7 @@ def get_db2_sql_engine(config) -> Engine: # connection_string = "ibm_db_sa+pyodbc://db2inst1:* # @localhost:50000/TESTDB" - connection_string = "ibm_db_sa+pyodbc://{}:{}@{}:{}/{}".format( + connection_string = "ibm_db_sa://{}:{}@{}:{}/{}".format( config["username"], config["password"], config["hostname"], From ebfd808efbff2d176fc7686eb97f70a99252b63f Mon Sep 17 00:00:00 2001 From: mjsqu Date: Mon, 1 May 2023 14:46:00 +1200 Subject: [PATCH 2/2] Add comment regarding discover code now picking up aliases --- tap_db2/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tap_db2/__init__.py b/tap_db2/__init__.py index 2da6938..4e5375f 100644 --- a/tap_db2/__init__.py +++ b/tap_db2/__init__.py @@ -301,6 +301,7 @@ def discover_catalog(db2_conn, config): LOGGER.info("Tables fetched, fetching columns") # Query for LUW DB2 instances only - SYSCAT may not exist on Z/OS + # 1.0.4 - updated to include BASE_TABNAME check for aliases column_results = open_conn.execute( """ SELECT