Skip to main content
Each file in app/adapters/ defines one adapter — a named binding between the runtime and a database. Adapter files are YAML documents with a fixed schema.

Full schema

app/adapters/primary-db.terse
name: primary-db
connector: postgres
connection_string: 'postgresql://user:pass@host:5432/db'
options:
  sslmode: require
  max_connections: '10'

Field reference

name
string
Adapter identifier, referenced by tools via use. Must be unique across all adapters. Must match ^[a-zA-Z][a-zA-Z0-9_-]*$.Default: filename without the .terse extension (e.g., primary-db from primary-db.terse).
connector
string
required
Connector type. Determines which database driver to use.Allowed values: postgres, mysql, mongodb, redis
connection_string
string
required
Database connection URI. Supports {{ env.VAR }} placeholders for secrets.
connection_string: 'postgresql://{{ env.DB_USER }}:{{ env.DB_PASS }}@{{ env.DB_HOST }}:5432/{{ env.DB_NAME }}'
options
object
Driver-specific key-value options. All values must be strings.
options:
  sslmode: 'require'
  connect_timeout: '10'

Connection string formats

postgresql://user:password@host:port/database?param=value
Standard PostgreSQL DSN. Supports all driver parameters in the query string or options map.Common options:
KeyExampleDescription
sslmoderequire, disable, verify-fullSSL mode
connect_timeout"10"Timeout in seconds
application_name"hyperterse"Name reported to server

Lifecycle

1

Discovery

The compiler scans app/adapters/*.terse for adapter definitions.
2

Validation

Connector type, connection string presence, and name uniqueness are verified at compile time.
3

Initialization

At startup, all referenced adapters initialize their connections in parallel.
4

Execution

Tools resolve adapters by name when executing statements.
5

Shutdown

All connectors close concurrently on termination.
If any adapter fails to connect during initialization, the server does not start.

JSON Schema

Editor validation: schema/adapter.terse.schema.json. Associate with **/adapters/*.terse. See Configuration schemas.