Data connectivity and ingestion
Bruin uses named connections to link pipeline assets to external systems. A connection defines access to one system. Pipeline settings choose that connection for queries or data movement. This separates system access from pipeline logic and lets the same pipeline use different environments.
Connection model
Connections provide one shared identity for configuration, runtime access, and ingestion. Each named record has a platform type plus the access and behavior settings that platform needs.
Connection records
A connection record can hold credentials, endpoint details, and platform options. Sensitive values stay distinct from normal connection details so Bruin can use them at run time without treating them as display data. The shared metadata can also limit how many assets use one connection at the same time. See Connection configuration for setup rules.
Some connection settings affect how Bruin reaches a system rather than what data an asset selects:
- Database and warehouse connections can route direct queries through Bruin Cloud with
use_cloud. - Database and warehouse connections can expose
read_onlyaccess. Such a connection can serve direct queries but cannot be used as an ingestion transfer endpoint. - BigQuery can choose its source read path with
read_api. - DuckDB can use a local database or a remote Quack service. These are separate modes with different access requirements.
The connection type defines the supported access model. A type may support direct queries, ingestion, or both.
References: pkg/…/connections.go• L18-50 pkg/…/connections.go• L31-43 pkg/…/connections.go• L82-98 pkg/…/connections.go• L1144-1169
Environment scope
An environment is the selected set of named connections for a run. Bruin resolves the names used by pipeline assets against that set, so development and production can use different access details without changing asset definitions. Connections may come from the normal project configuration or an external secrets source that keeps the same name-based contract.
References: pkg/…/manager.go• L278-305 pkg/…/manager.go• L398-451 pkg/…/manager.go• L715-752
Runtime access
At run time, Bruin turns each configured record into the client needed by its platform. The runtime manager keeps the usable client and the typed connection details under the same name. Direct asset operations and ingestion can therefore resolve one connection identity while preserving the information needed for credential masking and platform-specific behavior.
The same model can support a special ingestion path even when direct access uses a shared client. Vitess and PlanetScale use MySQL-style direct access but have dedicated ingestion forms. A remote DuckDB connection uses the Quack service instead of a local database.
References: pkg/…/connection.go• L175-343 pkg/…/connection.go• L396-463 pkg/…/connection.go• L1473-1536 pkg/…/connection.go• L2246-2265
Pipeline connection selection
Pipeline assets select named connections through explicit settings or pipeline defaults. This gives each asset control when needed while keeping repeated destination choices in one place.
Default connections
default_connections maps a platform type to a named connection in pipeline.yml. An asset-level connection takes priority. For an ingestr asset, destination_connection provides a destination-specific choice when connection is not set. If no explicit choice exists, Bruin infers the destination type and uses its pipeline default.
References: pkg/…/pipeline.go• L2544-2589 pkg/…/variant.go• L241-245
Source and destination roles
An ingestion asset normally has two roles. The source connection identifies the system and resource to read. The destination connection identifies where Bruin writes the asset result. Bruin tracks both names so it can check that the selected environment provides the required access before the run.
This diagram shows how environment selection becomes a data movement step.
flowchart LR
A[Selected environment] --> B[Source connection]
A --> C[Destination connection]
B --> D[External source]
D --> E[Ingestion asset]
E --> C
C --> F[External destination]
References: pkg/…/pipeline.go• L2432-2479 pkg/…/pipeline.go• L2529-2534 pkg/…/pipeline.go• L2544-2589
Ingestion boundary
Bruin gives ingestion assets a common way to move data between supported systems. The asset names the source and resource. Bruin resolves the named connections into the transfer format expected by the ingestion service, which keeps platform-specific access rules outside the pipeline definition.
Ingestion assets
The ingestr asset is Bruin's general data movement path. It reads from a source connection and resource, then writes to a destination chosen by an explicit connection or a destination-type default. The asset can also choose how later runs affect the destination, such as replacing, appending, or merging rows. See Ingestion operators for the asset contract.
References: pkg/…/operator.go• L206-227 pkg/…/operator.go• L333-402
Runtime connection format
Bruin resolves a named connection into an ingestion URI when the asset runs. The URI is the contract between the connection manager and the ingestion service. If Bruin cannot resolve a source or destination, or the connection type has no ingestion form, the asset stops before data movement begins.
The boundary also carries selected connection behavior into ingestion. It can apply source URI normalization, request a change-data-capture form, pass BigQuery's read path, or create the remote form for Quack and other platform-specific sources. A read-only connection deliberately refuses this form so query-only access cannot become a write path.
References: pkg/…/uri.go• L16-57 pkg/…/uri.go• L60-148 pkg/…/connection.go• L1473-1536 pkg/…/connection.go• L2246-2265
Batch and continuous ingestion
Most ingestion assets complete as finite batch loads. Streaming assets stay active and read new records over time. Bruin keeps this continuous mode separate from normal batch execution, while the source connection still provides access and the asset still defines the destination behavior.
References: pkg/…/operator.go• L237-331 pkg/…/operator.go• L518-615
Connector coverage
Bruin applies the same named-connection model to warehouses, databases, files, APIs, business tools, and message systems. The platform type determines the access fields and the operations available to the matching asset operator.
Integration categories
The main connector groups are:
- Data platforms: warehouses, databases, local data stores, and object storage.
- Application sources: business systems that expose records through APIs.
- Files and services: local files, remote files, HTTP endpoints, and spreadsheets.
- Streams and brokers: systems that provide records over time.
The presence of a connection type does not mean that every source, destination, write mode, or streaming mode is supported. See Supported integrations for current coverage and capability limits.
References: pkg/…/connection.go• L175-337 pkg/…/connections.go• L71-76 pkg/…/connections.go• L1050-1058 pkg/…/connections.go• L1104-1127
Source catalog
The ingestion source catalog describes the resources that a source exposes. It gives asset setup a shared view of source names, resource names, keys, incremental fields, and default load behavior. This lets source selection and validation use the same data model as ingestion.
References: pkg/…/sources.go• L1-35 pkg/…/sources.go• L1531-1568
Connection operations
Connection operations help move a data flow from configuration to a known-good run. The CLI can list configured connections, add or delete them, and test a connection when its client supports a test operation.
Use this path when bringing a flow online:
- Define the connection in the selected environment or secrets source.
- Use the exact connection name in the pipeline and asset settings.
- Test the connection when the platform supports it.
- Validate the pipeline to catch missing source or destination names.
- Run the ingestion asset and inspect the destination result.
References: cmd/connections.go• L80-207 cmd/connections.go• L296-368 cmd/connections.go• L379-493 pkg/…/manager.go• L313-332
Change checklist
When these files or sections are changed, remember to consider these:
- Keep a connection type aligned across its configuration shape, runtime client, typed details, and ingestion URI support.
- When changing read-only behavior, keep direct query access and ingestion URI rejection aligned.
- When changing DuckDB modes, preserve the separation between local path access and remote Quack access.
- When changing connection selection, check asset overrides, pipeline defaults, and source or destination dependency checks together.
- When changing URI rules, check normal loads, CDC, streaming, and platform-specific URI options together.
- When adding a connector, register its configuration, runtime access, and ingestion behavior as one contract.
- When changing source catalog metadata, check source selection and incremental load behavior.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The selected environment lacks a named source or destination | The asset stops before data movement | Select the correct environment and use the exact connection name |
| No destination mapping resolves | Bruin cannot choose where to write | Set an asset connection, a destination connection, or a matching pipeline default |
| A connection type has no ingestion URI | The transfer stops before it starts | Use a type supported for the required ingestion role |
| A read-only connection is used for ingestion | The connection cannot produce the transfer form | Use a writable connection for ingestion |
| DuckDB mixes local and Quack fields | Connection setup fails because the modes conflict | Use either local fields or quack: true with its remote access fields |
| A source or destination lacks the selected load capability | Ingestion rejects the requested mode | Check the integration capability before choosing the mode |
| A streaming asset runs as a normal batch | The stream cannot run as a continuous process | Start it with the stream run mode |
| Runtime client and typed details use different names | Lookup or credential masking misses part of the connection | Keep both records under the exact same name |
Key files
| File | Why to read it |
|---|---|
| pkg/…/connections.go | Defines the shared connection metadata and platform connection shapes. |
| pkg/…/manager.go | Explains environment selection and named connection lookup. |
| pkg/…/connection.go | Shows how configured records become runtime access and typed details. |
| pkg/…/pipeline.go | Defines asset connection selection and source or destination dependencies. |
| pkg/…/operator.go | Shows the high-level ingestion path and batch or stream behavior. |
| pkg/…/uri.go | Defines the handoff from named connections to ingestion URIs. |
| pkg/…/sources.go | Defines the source and resource catalog used during ingestion setup. |
| docs/connection-configuration.md | Explains how engineers define connection records. |
| docs/ingestion-operators.md | Explains how assets use source and destination connections. |
| docs/supported-integrations.md | Lists current connector coverage and capability limits. |