SQLite Connection

The SQLite connection type provides connection to a SQLite database.

Configuring the Connection

Host (optional)

The host to connect to. This can either be a file on disk or an in-memory database. If not set, an in-memory database is being used.

Extra (optional)

Specify the extra parameters (as json dictionary) that can be used in the sqlite connection. See Recognized Query Parameters for all supported parameters.

URI format example

If serializing with Airflow URI:

export AIRFLOW_CONN_SQLITE_DEFAULT='sqlite://relative/path/to/db?mode=ro'

or using an absolute path:

export AIRFLOW_CONN_SQLITE_DEFAULT='sqlite:///absolute/path/to/db?mode=ro'

Note the three slashes after the connection type.

Or using an in-memory database:

export AIRFLOW_CONN_SQLITE_DEFAULT='sqlite://?mode=ro'

When specifying the connection as an environment variable in Airflow versions prior to 2.3.0, you need to specify the connection using the URI format.

Note that all components of the URI should be URL-encoded.

JSON format example

If serializing with JSON:

export AIRFLOW_CONN_SQLITE_DEFAULT='{
    "conn_type": "sqlite",
    "host": "relative/path/to/db",
    "extra": {
        "mode": "ro"
    }
}'

Was this entry helpful?