Sources
The source side of a pipeline owns the PIPELINE.READ phase. A source adapter bridges a transport-specific read (OData V4, OData V2, REST, CQN) to a uniform streaming contract the plugin consumes.
One source adapter is resolved per pipeline at registration time.
Resolution order
addPipeline(...) resolves the source adapter in this order:
config.source.adapter— class reference extendingBaseSourceAdapter. Full control; skips everything below.config.source.kind— explicit transport selector:'cqn' | 'odata' | 'odata-v2' | 'hcql' | 'rest'.cds.requires.<service>.kind(orremote.kind) — auto-detected for annotation-wired pipelines. Unknown values fall back toRemoteCqnAdapter.
Built-in source adapters
Source cds.requires.<service>.kind | Adapter | Page |
|---|---|---|
odata (OData V4) | RemoteCqnAdapter | Remote CQN (OData & HCQL) |
odata-v2 | RemoteCqnAdapter | Remote CQN (OData & HCQL) |
hcql | RemoteCqnAdapter | Remote CQN (OData & HCQL) |
rest | RestAdapter | REST |
cqn / postgres / hana / sqlite / better-sqlite / in-process CAP services | CqnAdapter | CQN |
| Anything else | Register a custom source adapter |
Remote CQN (OData & HCQL) — CQN reads against remote CAP services. CAP selects OData or HCQL on the wire. Delta modes (
timestamp,key,datetime-fields), server-driven paging, consumption-view column restriction including flattened associations when HCQL is available.REST — Plain JSON over HTTP — no CDS model. Cursor / offset / page pagination, configurable delta URL parameter, nested-response extraction via
dataPath.CQN — In-process CAP services and
cds.requiresDB bindings (postgres,hana,sqlite, …). Serves both entity-shape and query-shape reads.Custom source adapter — Extend
BaseSourceAdapterto read from a transport the plugin does not ship. Worked example: a CSV-file source adapter.
Delta strategies
Source adapters translate the pipeline's config.delta + the tracker watermark into a source-side predicate (OData $filter, REST query param, CQN WHERE, …):
| Strategy | Watermark | Typical use |
|---|---|---|
| timestamp | tracker.lastSync (ISO timestamp) | Most common. Requires a reliable modifiedAt-style field on the source. |
| key-based | tracker.lastKey (primary-key value) | Append-only feeds where rows are keyed monotonically. |
| datetime-fields | Per-field timestamps in a composite watermark | Sources exposing several independently updated timestamps. |
All three are implemented for OData V4 and V2. REST supports timestamp. CQN supports timestamp and key. Query-shape pipelines (with source.query) sidestep delta entirely — see Concepts → Inference rules.
See also
- Concepts → Terminology — source / target / tracker vocabulary.
- Concepts → Inference rules — read-shape inference and registration validation.
- Targets — the peer section covering the WRITE phase.