jusi-postgres
jusi-postgres is the PostgreSQL exact-provider plugin for Jusi 1.0 and the
shared jusi-sql family. It exposes the postgres/postgresql provider for
%%sql cells. The family owns target selection, magic dispatch, completion
ranges, metadata caching, operation routing, and common VisiData SQL commands.
Example session config:
[sql.targets.analytics]
provider = "postgres"
host = "localhost"
port = 5432
dbname = "analytics"
user = "me"
initial_fetch = 100
All psycopg connection options may be provided in the target config. The
additional krb5ccname option points at a custom Kerberos credential cache and
is passed to libpq through KRB5CCNAME while connecting.
Metadata for SQL completion is collected asynchronously on a separate connection. Large catalogs should be filtered or disabled:
[sql.targets.analytics]
provider = "postgres"
host = "db.example.com"
dbname = "analytics"
user = "me"
metadata_schemas = ["public", "analytics"]
metadata_max_rows = 1000000
collect_metadata = true
Use collect_metadata = false to skip completion metadata for a target. If
collection crosses metadata_max_rows, it stops and warns that schema
filtering is required. Provider options belong in the target configuration;
the shared Jusi 1.0 %%sql syntax accepts one target alias.
VisiData mappings:
1to9: fetch that many more rows for the active result sheet.gf: prompt for a row count to fetch;0fetches the rest of the cursor.gc: commit the current connection.gr: roll back the current connection.gb: write the selected raw cell value to a temporary file and open it with VisiData. The command prompts for an optional extension; an empty extension lets VisiData infer the file type from content and filename.
Follow-up cells reuse the same VisiData application, PostgreSQL connection,
transaction, and server-side cursors. JusiInterrupt requests cancellation on
that connection. Closing the client closes its cursors, metadata connection,
main connection, private control socket, and staged launch data.
Local development database
Start a disposable PostgreSQL fixture:
scripts/run-postgres.sh
The script builds jusi-postgres-dev, runs a local container on
127.0.0.1:55432, waits for readiness, and prints this config:
[sql.targets.local_postgres]
provider = "postgres"
host = "127.0.0.1"
port = 55432
dbname = "jusi"
user = "jusi"
password = "jusi"
initial_fetch = 25
The fixture creates demo.accounts, demo.events, demo.account_summary,
demo.account_event_count(bigint), and demo.blob_files for result browsing,
completion checks, and raw bytea/blob handling.
For an already-running development container, install or refresh the blob table:
scripts/install-blob-fixture.sh
The source zip fixture is stored at fixtures/test-blob.zip.
Release files for jusi-postgres 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jusi_postgres-0.2.0.tar.gz | 17.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jusi_postgres-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.6 kB
Release files / jusi_postgres-0.2.0.tar.gz
| Download URL | jusi_postgres-0.2.0.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b955e4df72dd8ac11babe7c29dd09edeaa7c92eee7854e0c37969afd776f8308
|
|
BLAKE2b-256 checksum How to use checksums |
712ab4377b9d15824262373f66d4bcadaf98fd0f37ab297af9e41226064c84d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / jusi_postgres-0.2.0-py3-none-any.whl
| Download URL | jusi_postgres-0.2.0-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c21a247f73c741ac749ce8b7decd713991d2ada95f5dec578a0f311f6a49fbe2
|
|
BLAKE2b-256 checksum How to use checksums |
4eff79ed00f25648392737e8f23041e6f0ff477bf089777939547c05e2d8bfcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|