SelfSync

Explore your database with DuckDB CLI

The DuckDB CLI is the reference way to open a DuckDB database: a single binary, no setup, the latest DuckDB features as soon as they are released. Type SQL, get nicely formatted tables back.

It is also what the other tools build on: the DuckDB UI and the Claude integration both start from it.

Runs on
macOS, Windows, Linux
Price
Free, open source
Website
duckdb.org

Get started

  1. Install the DuckDB CLI

    Pick the command for your system.

    # macOS
    brew install duckdb
    
    # Windows
    winget install DuckDB.cli
    
    # Linux
    curl https://install.duckdb.org | sh
  2. Open the database

    From the folder holding your database. -readonly guarantees nothing gets modified.

    duckdb -readonly selfsync-db.duckdb
  3. Explore the tables

    .tables lists the tables, DESCRIBE their columns. Every column carries a comment explaining what it holds.

    .tables
    DESCRIBE z_fit_session_mesgs;
    SELECT column_name, comment
    FROM duckdb_columns()
    WHERE table_name = 'z_fit_session_mesgs';
  4. Run a first query

    Every statement ends with a semicolon.

    SELECT z_sport AS sport,
           count(*) AS sessions,
           round(sum(z_total_distance) / 1000, 1) AS km
    FROM z_fit_session_mesgs
    GROUP BY ALL
    ORDER BY km DESC;
  5. Export the results

    Need the data in a spreadsheet? Export any query to CSV, Parquet or JSON.

    COPY (FROM z_fit_session_mesgs) TO 'sessions.csv';

Good to know

  • Type .help to list the dot commands and .mode line to display wide rows one column per line.
  • Press Ctrl + D or type .quit to exit.

Other tools

Wondering what a table or a column holds? Browse the FIT file reference.