Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sets88/dbcls
DbCls is a versatile terminal client that supports various databases
https://github.com/sets88/dbcls
clickhouse clickhouse-client db mysql postgres psql
Last synced: about 1 month ago
JSON representation
DbCls is a versatile terminal client that supports various databases
- Host: GitHub
- URL: https://github.com/sets88/dbcls
- Owner: Sets88
- License: bsd-3-clause
- Created: 2023-08-26T08:15:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-19T16:39:57.000Z (4 months ago)
- Last Synced: 2024-10-11T09:05:39.957Z (about 1 month ago)
- Topics: clickhouse, clickhouse-client, db, mysql, postgres, psql
- Language: Python
- Homepage:
- Size: 410 KB
- Stars: 18
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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/editor.png)
![Data representation](/data/data.png)
## Installation
```bash
pip install dbcls
```## Run
```bash
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
``` bash
dbcls -c config.json mydb.sql
```Where config file is:
```json
{
"host": "127.0.0.1",
"port": "3306",
"username": "user",
"password": "mypasswd",
"dbname": "mydb",
"engine": "mysql"
}
```or from bash file
```bash
#! /bin/bashCONFIG='{
"host": "127.0.0.1",
"port": "3306",
"username": "user",
"password": "mypasswd",
"dbname": "mydb",
"engine": "mysql"
}'dbcls -c <(echo "$CONFIG") mydb.sql
```## Hotkeys
- Alt + r - Execute query under cursor or selected text
- Alt + e - Show databases list
- Alt + t - Show tables list
- Ctrl + q - Quit
- Ctrl + s - Save file## 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