Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

db connectors

The config fields of a db connector, which backs PostgreSQL, MySQL, SQLite and MongoDB.

Runs parameterized queries against PostgreSQL, MySQL, SQLite, or MongoDB. The connection_string scheme selects the backend: postgres://, mysql://, sqlite:, mongodb://, or mongodb+srv://. There is no driver field.

{
  "name": "orders-db",
  "connector_type": "db",
  "config": {
    "type": "db",
    "connection_string": "env://ORDERS_DB_URL",
    "max_connections": 10,
    "connect_timeout_ms": 5000,
    "query_timeout_ms": 30000
  }
}
FieldTypeRequiredDefaultDescription
connection_stringstringyesDatabase URL; the scheme selects the backend. Carries credentials, and is always masked in API reads
max_connectionsintegernoConnection pool maximum size
connect_timeout_msintegernoConnection establishment timeout; also caps MongoDB server selection
query_timeout_msintegernoPer-query timeout
allow_private_urlsbooleannofalseAllow private and internal IP addresses (SSRF protection). Ignored for sqlite:, which opens a file
operationsobjectnoall allowedread / insert / update / delete / upsert / raw_write — see Operation gates
dialectobjectnoboth guards offDialect guards
aggregate_write_stagesbooleannofalseMongoDB only: permit the $out/$merge write stages in mongo_aggregate pipelines. The one default-deny gate — an aggregation must not silently write

There are two ways to talk to it. The portable data_query / data_write dialect runs unchanged against SQL, MongoDB and Elasticsearch. The other is raw SQL through db_read / db_write.

There is no retry field: a statement that timed out may already have been applied, so database calls are never re-driven. See Retries. Bound the call with connect_timeout_ms and query_timeout_ms instead.

Note

A mongodb:// or mongodb+srv:// scheme makes this a MongoDB connector. data_query and data_write run against it unchanged (pass a database field in the task input); the raw-native surface is the mongo_read / mongo_write / mongo_aggregate trio, whose documents are extended JSON ($oid, $date, nested shapes).

Dialect guards

db and es connectors carry a dialect block that bounds what the portable dialect may reach. Operation gates answer which verbs; dialect guards answer which tables. Both guards default to off.

FieldTypeRequiredDefaultDescription
require_schemabooleannofalseRefuse any data_query / data_write call without a real schema: at least one declared entity, and not "unmapped": "identity"
allowed_entitiesarray of stringsno[] (unrestricted)Physical table, collection, or index names the dialect may touch. Matched after schema renames apply; covers relation targets and junction tables

Unknown keys inside dialect are refused on create and update.

Last verified 14 September 2026