Using CloudQuery Within Apache Airflow
If your team's workflow is based on Apache Airflow, introducing CloudQuery syncs into it is simple!
In this blog post, we'll go through setting up a basic Airflow DAG that syncs the whole catalog of xkcd comics into a local SQLite database using the SQLite destination integration. This DAG can be run entirely locally, and you don't need to pre-download CloudQuery (although if you'd like to, you can download CloudQuery here), SQLite or log in to anything.

We're gonna define two tasks in our DAG:
- Download CloudQuery binary: it will inspect the host's OS & ARCH and get the appropriate binary for the supplied version.
- Run the Sync: it will read our spec and run the CloudQuery sync.
The DAG will require two parameters:

- The version of the CloudQuery binary. It defaults to the current latest release: v6.4.1.
- The path to the sync's specification file. It defaults to the folder where the dag file is.
Let's use this basic spec, which uses xkcd as a source and SQLite as a destination
The code required to run the sync is surprisingly simple:
Upon running the DAG in the Airflow UI, the download task succeeds:

You can visualize the DAG and wait until it completes:

And voilà! The whole xkcd catalog is in our local SQLite database!

Check the full example here: https://github.com/cloudquery/airflow-dag-cloudquery
Try CloudQuery yourself
Self-hosted, open source, and free to start. Or schedule a demo to see the managed version.



