SQLite

Connect & Ingest data from / to a SQLite database

Sling CLI Setup

The following credentials keys are accepted:

  • instance (required) -> The local file path, HTTP or S3 url of the database file

  • access_key_id (optional) -> The Access Key ID to access the bucket (if providing a S3 url)

  • secret_access_key (optional) -> The Secret Key to access the bucket (if providing a S3 url)

  • endpoint (optional) -> The S3 endpoint hostname for non-AWS providers (if providing a S3 url). Examples: nyc3.digitaloceanspaces.com, a345678c73f3e8bddd084cb125876543.r2.cloudflarestorage.com, etc.

Here are examples of setting a connection named SQLITE. We must provide the type=sqlite property:

# for local files 
$ sling conns set SQLITE type=sqlite instance=/path/to/file.db

# for local files (Windows), don't use backslash (\)
$ sling conns set SQLITE type=sqlite instance=C:/path/to/file.db

# for HTTP 
$ sling conns set SQLITE_HTTP type=sqlite instance=https://<url>

# for S3
$ sling conns set SQLITE_S3 type=sqlite instance=s3://<bucket>/<key> access_key_id=<access_key_id> secret_access_key=<secret_access_key>

# Or use url (only for local files)
$ sling conns set SQLITE url="sqlite:///path/to/file.db"

# url for Windows, don't use backslash (\)
$ sling conns set SQLITE url="sqlite://C:/path/to/file.db"

Environment Variable

export SQLITE='sqlite:///path/to/file.db'

$env:SQLITE="sqlite://C:/path/to/file.db" # For Windows PowerShell

Sling Env File YAML

See here to learn more about the sling env.yaml file.

connections:
  SQLITE:
    type: sqlite
    instance: <instance>

Specifying a SQLite Binary Path

If you already have SQLite on your machine and would like to use it (instead of having Sling download it), you can specify the binary path this way:

export SQLITE_PATH='/opt/homebrew/bin/sqlite'

If you are facing issues connecting, please reach out to us at support@slingdata.io, on discord or open a Github Issue here.

Last updated