Project-Local Targets
Project-local targets are useful when a repository has its own development database, scratch SQLite file, or warehouse schema.
Add A Local Target
Section titled “Add A Local Target”From inside a git repository:
tonic connections add postgres app-dev \ --host localhost \ --user app \ --password-env PGPASSWORD \ --context database=app_dev \ --context schema=public \ --localThis writes <repo-root>/.tonic/config.yaml.
Show Effective Targets
Section titled “Show Effective Targets”tonic connections showThe same target name may exist globally and locally. The local target replaces the global target for commands run inside that repo.
Keep Secrets Out Of The Repo
Section titled “Keep Secrets Out Of The Repo”Config stores secret references, not raw credentials.
connections: app-dev: backend: postgres secrets: password_env: PGPASSWORDEach developer can provide PGPASSWORD through their shell, direnv, or secret manager.
Useful Pattern
Section titled “Useful Pattern”Use a shared target name in scripts and let local config decide where it points.
tonic query exec --target app-dev --sql 'select current_database()'