Saved Targets
A target is a named database connection stored in tonic config. Query, inspect, and service execution all start by resolving a target name from effective config.
This is a product boundary: tonic is not an ad hoc connection-string runner.
Where Targets Appear
Section titled “Where Targets Appear”Targets are visible in every execution surface:
tonic query exec --target warehouse --sql 'select 1'-- tonic-file: target=warehouse-- tonic-bind: handle=writer target=warehouse autocommit=off- JSON-RPC requests with a
targetfield
Supported Backends
Section titled “Supported Backends”Current target backends are:
postgressnowflakesqlitemysql
Each backend owns its connection options, default context keys, secret references, and inspect behavior.
Secrets
Section titled “Secrets”Secrets are referenced from config, not stored directly in config.
Postgres, MySQL, and Snowflake password auth use environment-variable references such as password_env. Snowflake keypair auth can also reference private_key_passphrase_env.
SQLite does not use secrets.
Target Resolution
Section titled “Target Resolution”Inline SQL requires --target.
Query files resolve targets in this order:
- Per-statement handle or target override.
- File-scoped
tonic-filemetadata. - CLI
--targetfallback. - Error when no target is available.
inspect and serve use the same target resolution and backend-opening code as query.