Skip to content

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:

  1. config.source.adapter — class reference extending BaseSourceAdapter. Full control; skips everything below.
  2. config.source.kind — explicit transport selector: 'cqn' | 'odata' | 'odata-v2' | 'hcql' | 'rest'.
  3. cds.requires.<service>.kind (or remote.kind) — auto-detected for annotation-wired pipelines. Unknown values fall back to RemoteCqnAdapter.

Built-in source adapters

Source cds.requires.<service>.kindAdapterPage
odata (OData V4)RemoteCqnAdapterRemote CQN (OData & HCQL)
odata-v2RemoteCqnAdapterRemote CQN (OData & HCQL)
hcqlRemoteCqnAdapterRemote CQN (OData & HCQL)
restRestAdapterREST
cqn / postgres / hana / sqlite / better-sqlite / in-process CAP servicesCqnAdapterCQN
Anything elseRegister 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.requires DB bindings (postgres, hana, sqlite, …). Serves both entity-shape and query-shape reads.

  • Custom source adapter — Extend BaseSourceAdapter to 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, …):

StrategyWatermarkTypical use
timestamptracker.lastSync (ISO timestamp)Most common. Requires a reliable modifiedAt-style field on the source.
key-basedtracker.lastKey (primary-key value)Append-only feeds where rows are keyed monotonically.
datetime-fieldsPer-field timestamps in a composite watermarkSources 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

Released under the MIT License.