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
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 type. Determines which database driver to use.Allowed values: postgres, mysql, mongodb, redis, sqlite
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 }}'
Driver-specific key-value options. All values must be strings.options:
sslmode: 'require'
connect_timeout: '10'
PostgreSQL
MySQL
MongoDB
Redis
SQLite
postgresql://user:password@host:port/database?param=value
Standard PostgreSQL DSN. Supports all driver parameters in the query string or options map.Common options:| Key | Example | Description |
|---|
sslmode | require, disable, verify-full | SSL mode |
connect_timeout | "10" | Timeout in seconds |
application_name | "hyperterse" | Name reported to server |
user:password@tcp(host:port)/database?param=value
Standard MySQL DSN. Options are typically passed as query parameters in the connection string.mongodb://user:password@host:port/database
mongodb+srv://user:password@cluster.example.com/database
Standard MongoDB URI. Supports replica sets and SRV records. Options are embedded in the connection string.redis://user:password@host:port/db_number
Standard Redis URI. Database number as path component. TLS, password, and other options are embedded in the URI.# local
:memory:
file:./data/app.db
/absolute/path/to/app.db
# remote (libSQL / Turso)
libsql://db-name-org.turso.io
https://db-name-org.turso.io
SQLite supports local files (or :memory:) and remote libSQL/Turso databases.
Use libsql://, https://, or http:// for remote; WebSocket URLs are not supported.options are appended as query parameters. Example:connector: sqlite
connection_string: 'libsql://db-name-org.turso.io'
options:
authToken: '{{ env.TURSO_AUTH_TOKEN }}'
sync_interval: '5s'
Lifecycle
Discovery
The compiler scans app/adapters/*.terse for adapter definitions.
Validation
Connector type, connection string presence, and name uniqueness are verified
at compile time.
Initialization
At startup, all referenced adapters initialize their connections in
parallel.
Execution
Tools resolve adapters by name when executing statements.
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.