Skip to content

Commit

Permalink
feat(ingest/mssql): enable TLS encryption for SQLServer using pytds (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
terratrue-daniel authored Nov 29, 2023
1 parent 10b7a95 commit ab10e6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions metadata-ingestion/docs/sources/mssql/mssql_recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ source:
username: user
password: pass

# Options
# Uncomment if you need to use encryption with pytds
# See https://python-tds.readthedocs.io/en/latest/pytds.html#pytds.connect
# options:
# connect_args:
# cafile: server-ca.pem
# validate_host: true

sink:
# sink configs

Expand Down
2 changes: 1 addition & 1 deletion metadata-ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"mlflow": {"mlflow-skinny>=2.3.0"},
"mode": {"requests", "tenacity>=8.0.1"} | sqllineage_lib,
"mongodb": {"pymongo[srv]>=3.11", "packaging"},
"mssql": sql_common | {"sqlalchemy-pytds>=0.3"},
"mssql": sql_common | {"sqlalchemy-pytds>=0.3", "pyOpenSSL"},
"mssql-odbc": sql_common | {"pyodbc"},
"mysql": mysql,
# mariadb should have same dependency as mysql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class SQLServerSource(SQLAlchemySource):
- Metadata for databases, schemas, views and tables
- Column types associated with each table/view
- Table, row, and column statistics via optional SQL profiling
We have two options for the underlying library used to connect to SQL Server: (1) [python-tds](https://github.com/denisenkom/pytds) and (2) [pyodbc](https://github.com/mkleehammer/pyodbc). The TDS library is pure Python and hence easier to install, but only PyODBC supports encrypted connections.
We have two options for the underlying library used to connect to SQL Server: (1) [python-tds](https://github.com/denisenkom/pytds) and (2) [pyodbc](https://github.com/mkleehammer/pyodbc). The TDS library is pure Python and hence easier to install.
"""

def __init__(self, config: SQLServerConfig, ctx: PipelineContext):
Expand Down

0 comments on commit ab10e6b

Please sign in to comment.