Skip to content

Commit

Permalink
docs: Updated docstring of JdbcHook and mentioned importance of sqlal…
Browse files Browse the repository at this point in the history
…chemy_scheme parameter
  • Loading branch information
davidblain-infrabel authored and potiuk committed Jul 26, 2024
1 parent 10dcbaa commit bef02a3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion airflow/providers/jdbc/hooks/jdbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ class JdbcHook(DbApiHook):
"providers.jdbc" section of the Airflow configuration. If you're enabling these options in Airflow
configuration, you should make sure that you trust the users who can edit connections in the UI
to not use it maliciously.
4. Patch the ``JdbcHook.default_driver_path`` and/or ``JdbcHook.default_driver_class`` values in the
4. Define the "sqlalchemy_scheme" property in the extra of the connection if you want to use the
SQLAlchemy engine from the JdbcHook. When using the JdbcHook, the "sqlalchemy_scheme" will by
default have the "jdbc" value, which is a protocol, not a database scheme or dialect. So in order
to be able to use SQLAlchemy with the JdbcHook, you need to define the "sqlalchemy_scheme"
property in the extra of the connection.
5. Patch the ``JdbcHook.default_driver_path`` and/or ``JdbcHook.default_driver_class`` values in the
``local_settings.py`` file.
See :doc:`/connections/jdbc` for full documentation.
Expand Down

0 comments on commit bef02a3

Please sign in to comment.