dbtalk
dbtalk is an LLM-ready database CLI for SQL operations, JSONL data transfer, permissions, and logical backups across SQLite, MySQL, and PostgreSQL.
Features
- Run SQL with
queryandexec, including bound parameters and timeouts - Transfer JSONL data between SQLite, MySQL, and PostgreSQL
- Manage MySQL schemas and users, and PostgreSQL schemas and roles
- Grant and revoke permission profiles; inspect native permissions with
permissions list/show - Create and restore MySQL SQL dumps and PostgreSQL custom archives
- Provide database-focused skills for Codex, Claude, and Grok agents
Installation
Requires Python 3.12+. Install the published CLI with:
uv tool install pomelo-dbtalk
dbtalk --help
The package is published on PyPI. Each version is also available from GitHub Releases as a wheel and standalone binaries for Linux x86_64, macOS (Apple Silicon and Intel), and Windows x86_64.
To use a standalone binary, download the matching asset from a release, make it executable on Linux or macOS, then run it directly:
chmod +x dbtalk-linux-x86_64
./dbtalk-linux-x86_64 --help
From a checkout, use uv:
uv sync --all-groups
uv run dbtalk --help
Quick start
Keep the connection string in the current directory's .env, then refer to it only by name:
DBTALK_DSN_APP=sqlite:///./data/app.db
uv run dbtalk query \
--dsn-env DBTALK_DSN_APP \
--sql 'SELECT 1 AS ok'
uv run dbtalk exec \
--dsn-env DBTALK_DSN_APP \
--sql 'CREATE TABLE IF NOT EXISTS notes (id INTEGER PRIMARY KEY, body TEXT NOT NULL)'
uv run dbtalk exec \
--dsn-env DBTALK_DSN_APP \
--file ./data/notes.sql
uv run dbtalk exec \
--dsn-env DBTALK_DSN_APP \
--file ./data/notes.sql \
--dry-run
query is read-only; exec runs a write-capable session. Add -v on a leaf command to see sanitized exception details.
Agents write the DSN to .env before the first database command. --dsn-env DBTALK_DSN_* reads the process environment first and only falls back to the current .env when that variable is absent.
Commands
| Command | Purpose |
|---|---|
dbtalk mysql schema |
Manage MySQL schemas/databases |
dbtalk mysql user |
Manage MySQL users |
dbtalk mysql grant / dbtalk mysql revoke |
Grant or revoke MySQL permissions |
dbtalk postgres schema |
Manage PostgreSQL schemas/databases |
dbtalk postgres role |
Manage PostgreSQL roles |
dbtalk postgres grant / dbtalk postgres revoke |
Grant or revoke PostgreSQL permissions |
dbtalk mysql permissions list/show |
Inspect native MySQL permissions |
dbtalk postgres permissions list/show |
Inspect native PostgreSQL permissions |
dbtalk mysql dump/restore |
Create or restore MySQL SQL dumps |
dbtalk postgres dump/restore |
Create or restore PostgreSQL custom archives |
dbtalk query/exec |
Query or execute SQL; exec --file runs a UTF-8 SQL script |
dbtalk export/import |
Transfer JSONL data |
Run uv run dbtalk --help or a subcommand's --help for full options.
DSNs and configuration
Supported DSN examples:
sqlite:///./data/app.db
mysql+pymysql://user:password@host:3306/app
postgresql+psycopg://user:password@host:5432/app
Every command accepts exactly one of --dsn DSN or --dsn-env NAME; --dsn remains available for direct integrations. Agent workflows must plan a DBTALK_DSN_* name, write the value to the current .env, and use only --dsn-env. .env.local and other dotenv variants are not loaded. Defaults are in dbtalk.yaml and can be overridden with DBTALK_ process environment variables.
Documentation
- Database operations: SQL, JSONL transfer, and DSN conventions
- MySQL guide: schemas, users, permissions, dump, and restore
- PostgreSQL guide: schemas, roles, permissions, dump, and restore
Agent integration
The repository ships a dbtalk plugin for Codex, Claude, and Grok with three skills:
dbtalk: SQL and JSONL data transferdbtalk-mysql: MySQL schemas, users, permissions, and dump/restoredbtalk-postgres: PostgreSQL schemas, roles, permissions, and dump/restore
Install or synchronize the local plugin with:
make install
See Agent plugin and skills for installation details, parameter constraints, and safety boundaries.
Development
make deps
make check
make test
make release
make check runs Ruff and Mypy. make test runs the test suite; integration tests requiring a real database are skipped by default.
License
Licensed under the Apache License, Version 2.0. See LICENSE.
Docker
docker build -t dbtalk .
docker run --rm dbtalk --help
Metadata
Release files for pomelo-dbtalk 0.30.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pomelo_dbtalk-0.30.5.tar.gz | 63.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pomelo_dbtalk-0.30.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 147.5 kB
Release files / pomelo_dbtalk-0.30.5.tar.gz
| Download URL | pomelo_dbtalk-0.30.5.tar.gz |
|---|---|
| Size | 63.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c2b9e771f0480a5b05788a2a2c8f8136d0aca5d7a8be5e3d102a2a930bd513ca
|
|
BLAKE2b-256 checksum How to use checksums |
6b2912221850f7b5d892820ddb5b9ea9634aa62466f5fff2be4361a6f2d8b2f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / pomelo_dbtalk-0.30.5-py3-none-any.whl
| Download URL | pomelo_dbtalk-0.30.5-py3-none-any.whl |
|---|---|
| Size | 83.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33b80e857c6edb5478b38d11ab59fb8c049910d87028865105813506977336fa
|
|
BLAKE2b-256 checksum How to use checksums |
242745ae258c90d537ae389142a7b94b9dd49672d8043719f05ea4f6d69f70eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|