Skip to content

Latest commit

 

History

History
75 lines (55 loc) · 2.44 KB

File metadata and controls

75 lines (55 loc) · 2.44 KB

SqliteOperator

Use the ~airflow.providers.sqlite.operators.SqliteOperator to execute Sqlite commands in a Sqlite database.

Using the Operator

Use the sqlite_conn_id argument to connect to your Sqlite instance where the connection metadata is structured as follows:

Sqlite Airflow Connection Metadata
Parameter Input
Host: string Sqlite database file
Schema: string Set schema to execute Sql operations on by default
Login: string Sqlite user
Password: string Sqlite user password
Port: int Sqlite port

An example usage of the SqliteOperator is as follows:

/../../airflow/providers/sqlite/example_dags/example_sqlite.py

Furthermore, you can use an external file to execute the SQL commands. Script folder must be at the same level as DAG.py file.

/../../airflow/providers/sqlite/example_dags/example_sqlite.py

Reference

For further information, look at:

Note

Parameters given via SqliteOperator() are given first-place priority relative to parameters set via Airflow connection metadata (such as schema, login, password etc).