Skip to main content

VisiData plugin for deferred execution with SQL databases via Ibis

Project description

vdsql: VisiData plugin for SQL Databases

A VisiData interface for relational and columnar databases

Powered by Ibis.

Features

  • query data in VisiData from any supported backend
  • output resulting query in SQL, Substrait, or Python

Confirmed supported backends

  • SQLite
  • DuckDB

Other backends supported by Ibis (read)

These backends are supported by Ibis and should work, but haven't been tested. If you have have problems connecting, please file an issue.

  • PostgreSQL
  • MySQL
  • ClickHouse
  • Apache Impala
  • Datafusion
  • Dask
  • PySpark
  • HeavyAI
  • Google BigQuery

Install latest release

This will install both:

  • the usual vd with the vdsql plugin available (use -f ibis to use Ibis instead of builtin loaders),

  • the vdsql script that acts identically to vd but will use Ibis instead of the builtin loader.

    pip install vdsql

    echo "import vdsql" >> ~/.visidatarc

Install manually as a VisiData plugin (development)

pip install git+https://github.com/visidata/vdsql.git

echo "import vdsql" >> ~/.visidatarc

Usage

deferred execution with Ibis

vd -f ibis <file_or_url>

where file_or_url is any connection string supported by ibis.connect().

IbisSheet

Only these commands are implemented to use Ibis expressions; others will use the internal VisiData implementation (and will only use the currently loaded rowset, limited to 10000 rows).

  • Shift+F frequency table
    • on the Frequency Sheet, Enter to filter source rows by that value
  • - to hide column
  • zM unfurl-col
  • ~/@/#/$/% to set column types
  • ^ to rename col
  • + to aggregate (name must be function on Ibis column expr; e.g. use mean, avg is not available)
  • z+ to calculate aggregation immediately
  • [ and ] family to sort
  • , to select rows
  • gt to toggle selection
  • " to filter selection
  • & to join

new commands for IbisSheet

  • v to cycle the sidebar between the generated SQL, the Ibis expression, the Substrait, and no sidebar

Notes

  • the SQL/sidebar expression shows what would be executed during reload, not necessarily what the current view is.
    • For example, opening a table through Ibis only loads the first 10,000 rows. Sorting the table adds an ORDER BY clause to the SQL, but only sorts those first 10,000 rows within VisiData. To re-run the query including the new ORDER BY clause, use Ctrl+R to reload the sheet.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vdsql-0.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

vdsql-0.1-py2.py3-none-any.whl (11.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file vdsql-0.1.tar.gz.

File metadata

  • Download URL: vdsql-0.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for vdsql-0.1.tar.gz
Algorithm Hash digest
SHA256 b0a181db5e9f42689c3d8dc757d98006fed19a236133f79007ad09f3199311ad
MD5 442f2c42da0c6eaf8152efc1ab280d17
BLAKE2b-256 6a92a46207dea01d23348777a05cd363dd2c4446223731299446838a64262374

See more details on using hashes here.

File details

Details for the file vdsql-0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: vdsql-0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for vdsql-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d5dfa7c6fbd734e312ab462e4a60695baca39502cb8fc45ddf6d77b6d5c5a370
MD5 0f87c953c2727ce61696ee1c1c02fc2c
BLAKE2b-256 55dd717795b7cac10d5e17649a85d2a11f8d94bd62962bf29cc8bd5ba003ba50

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page