.terse file under app/adapters/, and tools reference adapters by name through the use field. The framework handles connection pooling, health checks, and graceful shutdown.
Defining an adapter
Each adapter file declares a connector type and a connection string:connector field selects the database engine. The connection_string accepts {{ env.VAR }} placeholders, which are resolved at runtime from environment variables. Never commit plaintext credentials — always use environment variables or a secrets manager.
Supported connectors
Hyperterse ships with four built-in connectors:PostgreSQL
SQL queries via
postgresql:// connection strings.MySQL
SQL queries via DSN-format connection strings.
MongoDB
JSON command payloads via
mongodb:// connection strings.Redis
Key-value operations via
redis:// connection strings.Referencing adapters from tools
Tools point to an adapter by name:app
adapters
users-db.terse
analytics-db.terse
cache.terse
Lifecycle
All adapters referenced by at least one tool are initialized in parallel at startup. Each connector establishes its pool and runs a connectivity check. If any connector fails — unreachable host, invalid credentials, network timeout — the runtime exits immediately. This fail-fast behavior prevents serving tools that would error on every request. On shutdown (SIGINT / SIGTERM), all connectors close concurrently after in-flight queries complete.