Skip to content

Commit

Permalink
Merge pull request #217 from BritishGeologicalSurvey/215-make-oracled…
Browse files Browse the repository at this point in the history
…bhelperget_sqlalchemy_connection_string-use-oracle+oracledb-instead-of-oracle

215 make oracledbhelperget sqlalchemy connection string use oracle+oracledb instead of oracle
  • Loading branch information
volcan01010 authored Nov 26, 2024
2 parents fd9278e + 6ac4ecd commit e466256
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion etlhelper/db_helpers/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ def get_sqlalchemy_connection_string(self, db_params, password_variable):
Returns connection string for SQLAlchemy engine.
"""
password = self.get_password(password_variable)
return (f'oracle://{db_params.user}:{password}@'
return (f'oracle+oracledb://{db_params.user}:{password}@'
f'{db_params.host}:{db_params.port}/{db_params.dbname}')
2 changes: 1 addition & 1 deletion test/unit/test_db_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_connect(monkeypatch, db_params, driver, expected):


@pytest.mark.parametrize('db_params, expected', [
(ORACLEDB, 'oracle://testuser:mypassword@server:1521/testdb'),
(ORACLEDB, 'oracle+oracledb://testuser:mypassword@server:1521/testdb'),
(MSSQLDB,
'mssql+pyodbc://testuser:mypassword@server:1521/testdb?driver=test+driver'),
# NOQA
Expand Down

0 comments on commit e466256

Please sign in to comment.