blob: 22cb055af406a96bc6d1b6fe11698cf244ec3892 [file] [log] [blame]
:py:mod:`airflow.providers.jdbc.operators.jdbc`
===============================================
.. py:module:: airflow.providers.jdbc.operators.jdbc
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.jdbc.operators.jdbc.JdbcOperator
.. py:class:: JdbcOperator(*, sql, jdbc_conn_id = 'jdbc_default', autocommit = False, parameters = None, handler = fetch_all_handler, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
Executes sql code in a database using jdbc driver.
Requires jaydebeapi.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:JdbcOperator`
:param sql: the SQL code to be executed as a single string, or
a list of str (sql statements), or a reference to a template file.
Template references are recognized by str ending in '.sql'
:param jdbc_conn_id: reference to a predefined database
:param autocommit: if True, each command is automatically committed.
(default value: False)
:param parameters: (optional) the parameters to render the SQL query with.
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['sql']
.. py:attribute:: template_ext
:annotation: :Sequence[str] = ['.sql']
.. py:attribute:: template_fields_renderers
.. py:attribute:: ui_color
:annotation: = #ededed
.. py:method:: execute(context)
This is the main method to derive when creating an operator.
Context is the same dictionary used as when rendering jinja templates.
Refer to get_template_context for more context.