Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Fix the missing fields in database classes #729

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data_diff/databases/mssql.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class MsSQL(ThreadedDatabase):

default_database: str
_args: Dict[str, Any]
_mssql: Any

def __init__(self, host, port, user, password, *, database, thread_count, **kw):
args = dict(server=host, port=port, database=database, user=user, password=password, **kw)
Expand All @@ -188,6 +189,7 @@ def __init__(self, host, port, user, password, *, database, thread_count, **kw):
except KeyError:
raise ValueError("Specify a default database and schema.")

self._mssql = None
super().__init__(thread_count=thread_count)

def create_connection(self):
Expand Down
2 changes: 2 additions & 0 deletions data_diff/databases/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,13 @@ class Oracle(ThreadedDatabase):
CONNECT_URI_PARAMS = ["database?"]

kwargs: Dict[str, Any]
_oracle: Any

def __init__(self, *, host, database, thread_count, **kw):
super().__init__(thread_count=thread_count)
self.kwargs = dict(dsn=f"{host}/{database}" if database else host, **kw)
self.default_schema = kw.get("user").upper()
self._oracle = None

def create_connection(self):
self._oracle = import_oracle()
Expand Down