PUBLISHED:
CATEGORY: Stripe ▸ Misc
TAGS: sqlite

Download your Stripe data to a SQLite database

You can have all your Stripe data as SQLite tables in under a minute with the Table Dog CLI:

Create a config file

Save this to a file called config.json:

{
    "cmd": {
        "fn": "download",
        "args": {
            "from": {
                "stripe": {
                    "secret_key": "sk_test_... download at https://dashboard.stripe.com/apikeys"
                }
            },
            "to": {
                "sqlite": {
                    "file": "/absolute/path/db.sqlite"
                }
            },
            "options": {
                "watch": true
            }
        }
    },
    "log": "info"
}

Note: This TypeScript file documents all possible CLI options.

Install the tdog CLI

# macOS:
curl --output /usr/local/bin/tdog https://raw.githubusercontent.com/tabledog/tdog/0.2.0/archive/0.2.0/bin/tdog-x86_64-apple-darwin
chmod +x /usr/local/bin/tdog

Run tdog to download all of your tables

This will also poll the Stripe /events API and apply changes with less than a second delay.

tdog --json-file config.json