airflow.providers.sqlite.operators.sqlite

Module Contents

Classes

SqliteOperator

Executes sql code in a specific Sqlite database

class airflow.providers.sqlite.operators.sqlite.SqliteOperator(*, sql: Union[str, List[str]], sqlite_conn_id: str = 'sqlite_default', parameters: Optional[Union[Mapping, Iterable]] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Executes sql code in a specific Sqlite database

See also

For more information on how to use this operator, take a look at the guide: SqliteOperator

Parameters
  • sql (str or list[str]) -- the sql code to be executed. Can receive a str representing a sql statement, a list of str (sql statements), or reference to a template file. Template reference are recognized by str ending in '.sql' (templated)

  • sqlite_conn_id (str) -- reference to a specific sqlite database

  • parameters (dict or iterable) -- (optional) the parameters to render the SQL query with.

template_fields :Sequence[str] = ['sql'][source]
template_ext :Sequence[str] = ['.sql'][source]
ui_color = #cdaaed[source]
execute(self, context: Mapping[Any, Any]) None[source]

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.

Was this entry helpful?