Skip to content

tonic

Poke databases from your terminal like a professional idiot, but with saved targets, explicit query artifacts, and fewer mystery connection strings.

tonic is a tiny database octopus for people who know enough SQL to be dangerous and enough restraint to save their targets first. It keeps database access anchored to named local config, then gives you explicit query execution, schema inspection, transaction-aware files, and a local JSON-RPC boundary for editor clients.

Tini, the tonic octopus mascot, hovering over a tiny database

This is Tini. Tini pokes catalogs, remembers targets, and tries very hard not to let you paste production credentials into your shell history.

AlphaPostgresSnowflakeSQLiteMySQL
Saved targets

Name the database beast once, then stop juggling connection strings like cursed spaghetti.

Query artifacts

SQL files can say where they run, which handle they use, and what flavor of trouble they are causing.

Session aware

Reusable sessions keep transaction state around when your workflow needs more than one dramatic statement.

Schema inspect

Browse catalogs, schemas, tables, views, columns, and definitions without spelunking vendor docs every time.

Terminal window
tonic connections add sqlite scratch --path ./scratch.db --local
tonic query ping --target scratch
tonic query exec --target scratch --sql 'select sqlite_version() as version'
tonic inspect tables --target scratch --refresh

Query files make intent visible inside the artifact, which is nicer than whispering “trust me” at a migration-adjacent script:

-- tonic-file: target=warehouse context.schema=analytics autocommit=off
-- tonic-bind: handle=writer target=warehouse context.schema=public autocommit=off
select * from reports.daily_sales;
-- tonic: handle=writer
update reports.job_state set last_run_at = current_timestamp where name = 'daily_sales';
-- tonic: handle=writer
commit;
  • Local config first. Targets live in global or project-local config; secrets are referenced through environment variables.
  • Execution should be explicit. The target, context, handle, and session mode should be visible before SQL mutates data.
  • SQL remains SQL. Transaction control uses SQL statements such as begin, commit, rollback, savepoint, and release.
  • One runtime, many surfaces. The CLI and serve --stdio share target resolution, statement policy, execution, and inspect behavior.

Tonic stands for Tiny Octopus Navigating Infinite Catalogs. Why? Because every serious database tool needs at least one deeply unserious explanation.