Skip to main content

dbcls is a versatile client that supports various databases

Project description

DbCls

DbCls is a versatile client for multiple databases, enabling the editing and preservation of SQL queries in a file, and executing queries directly from the editor, thereby providing a convenient interface for data representation.

Briefly, this application combines the kaa editor and the visidata data visualization tool.

Editor

Data representation

Installation

pip install dbcls

Run

dbcls -H 127.0.0.1 -u user -p mypasswd -E mysql -d mydb mydb.sql

Using config file rather then process arguments to configure

dbcls -c config.json mydb.sql

Where config file is:

{
    "host": "127.0.0.1",
    "port": "3306",
    "username": "user",
    "password": "mypasswd",
    "dbname": "mydb",
    "engine": "mysql"
}

or from bash file

#! /bin/bash

CONFIG='{
    "host": "127.0.0.1",
    "port": "3306",
    "username": "user",
    "password": "mypasswd",
    "dbname": "mydb",
    "engine": "mysql"
}'

dbcls -c <(echo "$CONFIG") mydb.sql

Hotkeys

  • Alt + 1 - Autocompletion suggestion list
  • Alt + r - Execute query under cursor or selected text
  • Alt + e - Show database list, which has a submenu of .tables content
  • Alt + t - Show tables list, which has submenus with functionality to show schema or load some sample data
  • Ctrl + q - Quit
  • Ctrl + s - Save file

Commands

.tables - Show tables list

.databases - Show databases list

.use - Change database

.schema <table> - Show table schema

Options

-H --host

Host to connect to

-u --user

Username to connect as

-p --password

Password to use when connecting to server

-E --engine

Database engine, options are: mysql, postgresql, clickhouse

-d --database

Database to use

-P --port

Port number to use for connection (optional)

-c --config

Path to a config file to use

Bugs

See github issues: https://github.com/Sets88/dbcls/issues

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

dbcls-1.1.14.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

dbcls-1.1.14-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file dbcls-1.1.14.tar.gz.

File metadata

  • Download URL: dbcls-1.1.14.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for dbcls-1.1.14.tar.gz
Algorithm Hash digest
SHA256 122e97fe4a82a4899ad5e7802f437e5e038489e5a77699d46834e4990d1639e9
MD5 ec87fb0e8c9322fdad987595e2d86439
BLAKE2b-256 589f8481f409d80f57bad2ede39a99f6ed6c3cf43e60c814fd8aea0724056384

See more details on using hashes here.

File details

Details for the file dbcls-1.1.14-py3-none-any.whl.

File metadata

  • Download URL: dbcls-1.1.14-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for dbcls-1.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 7bc963f759bcd5738b0ca3792eaba37e83403a449087087d72d8a4402dad2a9b
MD5 95f2589d24916ceee5ea73b2e03ce683
BLAKE2b-256 e056fa52a7b0cbb1c5238b291b7db399c68c446cf6250e85149d87b6cb89b7c9

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page