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

Commit 30bd116

Browse files
author
Sergey Vasilyev
committed
Switch from cx_Oracle to oracledb
`cx_Oracle` is officially deprecated since 2021 (2 years go) and no new released were made. The new official library is `oracledb`. This warning is the first sentence in cx_Oracle's docs. New projects, such as data-diff, should use the new library. Luckily, `oracledb` is mostly a drop-in replacement for `cx_Oracle`, so no code changes are needed. Besides, `oracledb` provides 2 modes: the "thin" mode and the "thick" mode. The latter (`"thick") one requires binary libraries, the former one ("thin") works in pure Python. This simplifies the Oracle usage for users.
1 parent 2327d44 commit 30bd116

File tree

4 files changed

+53
-148
lines changed

4 files changed

+53
-148
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Test SQL code and preview changes by comparing development/staging environment d
2727
<p align="left">
2828
<img alt="dbt" src="https://seeklogo.com/images/D/dbt-logo-E4B0ED72A2-seeklogo.com.png" width="10%" />
2929
</p>
30-
30+
3131
<details>
3232
<summary> data-diff integrates with dbt Core to seamlessly compare local development to production datasets
3333

@@ -58,7 +58,7 @@ When comparing the data, `data-diff` utilizes the resources of the underlying da
5858
- Fully relies on the underlying database engine for computation
5959
- Requires both datasets to be queryable with a single SQL query
6060
- Time complexity approximates JOIN operation and is largely independent of the number of differences in the dataset
61-
61+
6262
## `hashdiff`
6363
- Recommended for comparing datasets across different databases
6464
- Can also be helpful in diffing very large tables with few expected differences within the same database
@@ -99,14 +99,14 @@ Check out [documentation](https://docs.datafold.com/reference/open_source/cli) f
9999
# Supported databases
100100

101101

102-
| Database | Status | Connection string |
103-
|---------------|-------------------------------------------------------------------------------------------------------------------------------------|--------|
104-
| PostgreSQL >=10 | 🟒 | `postgresql://<user>:<password>@<host>:5432/<database>` |
102+
| Database | Status | Connection string |
103+
|---------------|-------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
104+
| PostgreSQL >=10 | 🟒 | `postgresql://<user>:<password>@<host>:5432/<database>` |
105105
| MySQL | 🟒 | `mysql://<user>:<password>@<hostname>:5432/<database>` |
106106
| Snowflake | 🟒 | `"snowflake://<user>[:<password>]@<account>/<database>/<SCHEMA>?warehouse=<WAREHOUSE>&role=<role>[&authenticator=externalbrowser]"` |
107107
| BigQuery | 🟒 | `bigquery://<project>/<dataset>` |
108108
| Redshift | 🟒 | `redshift://<username>:<password>@<hostname>:5439/<database>` |
109-
| Oracle | 🟑 | `oracle://<username>:<password>@<hostname>/database` |
109+
| Oracle | 🟑 | `oracle://<username>:<password>@<hostname>/servive_or_sid` |
110110
| Presto | 🟑 | `presto://<username>:<password>@<hostname>:8080/<database>` |
111111
| Databricks | 🟑 | `databricks://<http_path>:<access_token>@<server_hostname>/<catalog>/<schema>` |
112112
| Trino | 🟑 | `trino://<username>:<password>@<hostname>:8080/<database>` |

β€Ždata_diff/sqeleton/databases/oracle.pyβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333

3434
@import_helper("oracle")
3535
def import_oracle():
36-
import cx_Oracle
36+
import oracledb
3737

38-
return cx_Oracle
38+
return oracledb
3939

4040

4141
class Mixin_MD5(AbstractMixin_MD5):

0 commit comments

Comments
Β (0)