airflow.providers.microsoft.mssql.hooks.mssql

Microsoft SQLServer hook module

Module Contents

Classes

MsSqlHook

Interact with Microsoft SQL Server.

class airflow.providers.microsoft.mssql.hooks.mssql.MsSqlHook(*args, sqlalchemy_scheme=None, **kwargs)[source]

Bases: airflow.providers.common.sql.hooks.sql.DbApiHook

Interact with Microsoft SQL Server.

property connection_extra_lower: dict[source]

connection.extra_dejson but where keys are converted to lower case. This is used internally for case-insensitive access of mssql params.

property sqlalchemy_scheme: str[source]

Sqlalchemy scheme either from constructor, connection extras or default.

conn_name_attr = 'mssql_conn_id'[source]
default_conn_name = 'mssql_default'[source]
conn_type = 'mssql'[source]
hook_name = 'Microsoft SQL Server'[source]
supports_autocommit = True[source]
DEFAULT_SQLALCHEMY_SCHEME = 'mssql+pymssql'[source]
get_uri()[source]

Extract the URI from the connection.

Returns

the extracted uri.

Return type

str

get_sqlalchemy_connection(connect_kwargs=None, engine_kwargs=None)[source]

Sqlalchemy connection object

get_conn()[source]

Returns a mssql connection object

set_autocommit(conn, autocommit)[source]

Sets the autocommit flag on the connection

get_autocommit(conn)[source]

Get autocommit setting for the provided connection. Return True if conn.autocommit is set to True. Return False if conn.autocommit is not set or set to False or conn does not support autocommit.

Parameters

conn (pymssql.connect) – Connection to get autocommit setting from.

Returns

connection autocommit setting.

Was this entry helpful?