airflow.providers.odbc.hooks.odbc¶
This module contains ODBC hook.
Module Contents¶
Classes¶
Interact with odbc data sources using pyodbc. |
- class airflow.providers.odbc.hooks.odbc.OdbcHook(*args, database=None, driver=None, dsn=None, connect_kwargs=None, sqlalchemy_scheme=None, **kwargs)[source]¶
Bases:
airflow.providers.common.sql.hooks.sql.DbApiHookInteract with odbc data sources using pyodbc.
See ODBC Connection for full documentation.
- property database(self)[source]¶
Database provided in init if exists; otherwise,
schemafromConnectionobject.
- property sqlalchemy_scheme(self)[source]¶
Database provided in init if exists; otherwise,
schemafromConnectionobject.
- property connection_extra_lower(self)[source]¶
connection.extra_dejsonbut where keys are converted to lower case.This is used internally for case-insensitive access of odbc params.
- property driver(self)[source]¶
Driver from init param if given; else try to find one in connection extra.
- property odbc_connection_string(self)[source]¶
ODBC connection string We build connection string instead of using
pyodbc.connectparams because, for example, there is no param representingApplicationIntent=ReadOnly. Any key-value pairs provided inConnection.extrawill be added to the connection string.
- property connect_kwargs(self)[source]¶
Returns effective kwargs to be passed to
pyodbc.connectafter merging between conn extra,connect_kwargsand hook init.Hook
connect_kwargsprecedesconnect_kwargsfrom conn extra.If
attrs_beforeprovided, keys and values are converted to int, as required by pyodbc.
- get_uri(self)[source]¶
URI invoked in
get_sqlalchemy_engine()method.