Pagination and streaming
Returning results a client can consume without loading everything — server-driven paging, and streaming large binaries rather than buffering them.
Overview
@sap/cds Applies implicit and explicit paging to collections, and streams large binary properties rather than buffering them.
com.sap.cds:cds-services-bom Limits and pages a Select query's result set, and streams cds.LargeString and cds.LargeBinary elements through a Reader or an InputStream rather than buffering them, with the streaming path tested on SAP HANASAP HANASAP’s relational database platform, which stores application data and executes SQL and SQLScript in the database, available on-premise and as the managed service SAP HANA Cloud.sap official, btp, PostgreSQLPostgreSQLA relational database. For CAP it is the production database when the answer is not HANA, reached through an adapter that translates CDS queries into its SQL. and H2.
Not covered: Paging stops at a numeric skip token, which capire states can return duplicate or missing rows if the entity set is modified between the calls: reliable pagination is opt-in, available only for OData V4, and takes no functions or arithmetic expressions in $orderby. Streaming stops at the element and at the database: SQLite reads a LargeBinary whole into memory, and keeping uploaded files in an object store, scanning them and annotating the upload control is attachmentsAttachmentsStoring a file somebody uploaded next to the record it belongs to, and getting it back out — where the bytes actually live, who may read them, and what the UI shows while they are being scanned.SAP and community, unassessed, where @cap-js/attachments@cap-js/attachmentsAn official CAP Node.js plugin for attachment handling, with local database storage and AWS S3, Azure Blob or GCP Object Store integration.sap official, cap and com.sap.cds:cds-feature-attachmentscom.sap.cds:cds-feature-attachmentsA CAP Java attachments package that adds an Attachments aspect and stores content in the database by default, or in AWS, Azure or Google Object Store through a separate module.sap official, cap take over.
No community artifact is documented here.
Artifacts
Content
Details
Coverage
For your agent
- Ref
capability:pagination-and-streaming- JSON
- /capabilities/pagination-and-streaming.json
- MCP
- Connecting an agent