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.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

vdsql-0.1.1-py2.py3-none-any.whl (11.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: vdsql-0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f874c521d67f723255c673434d6670e99fb465149625db528f512ec4f330f97e
MD5 878cc8c9390b791f4cbe40c0ae2dc67c
BLAKE2b-256 ebb975c9351e4bc8da6630be75aa60c91f852956067a404174d23358905341f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vdsql-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.1 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.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1de46336d93a0aa8e58cfedb10380abdd3680c1fd966d014f5f6b23e7ce974b7
MD5 1ed588d427babfe790839ed3d9e439fb
BLAKE2b-256 8378b914752e9b3b5217b067940ed87e9df5d21c1c84706dfc51dbf01c1077d1

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