Database

class airflow_plugins.operators.db.ChangeDatabaseName(sql=None, *args, **kwargs)[source]

Rename database in operator.

class airflow_plugins.operators.db.CreateDatabase(sql=None, *args, **kwargs)[source]

Operator which creates database in PostgreSQL.

class airflow_plugins.operators.db.CreateTableWithColumns(*args, **kwargs)[source]

Create database with columns.

class airflow_plugins.operators.db.DropDatabase(sql=None, *args, **kwargs)[source]

Drop database operator.

class airflow_plugins.operators.db.PostgresHook(database=None, fail_silently=False, *args, **kwargs)[source]

Tuned PostgreSQL hook which support running SQL like create database. Supports silent fail.

run(sql, autocommit=False, parameters=None)[source]

Runs a command or a list of commands. Pass a list of sql statements to the sql parameter to get them to execute sequentially

Parameters:
  • sql (str or list) – the sql statement to be executed (str) or a list of sql statements to execute
  • autocommit (bool) – What to set the connection’s autocommit setting to before executing the query.
  • parameters (mapping or iterable) – The parameters to render the SQL query with.
class airflow_plugins.operators.db.PostgresOperator(database=None, fail_silently=True, *args, **kwargs)[source]

PostgreSQL operator which uses PostgresHook