on ‎2021 Apr 06 4:15 PM
Dear all,
we want to make the data within our CAP app temporal.
first we import the temporal aspect into our schema and add the temporal aspect to our entity.
additionally the ValidFrom value has been added to uploaded csv files for our entity.
Once this is done the list report view does not show any entry any more.
using {
cuid,
managed,
temporal
} from '@sap/cds/common';
namespace test;
entity Books : cuid, managed, temporal {
title : String;
stock : Integer
}
Does anyone know why this occures respecitvely which step is missing?
capire - Temporal Data (cloud.sap)
Best Regards
Max
Request clarification before answering.
Max, I don't think you are missing anything. When you add the temporal aspect, the system adds valid from to the Primary Key of the table. You can validate that by running 'cds compile ./db/[schema_name].cds --to sql'
At present there is no standard handler to automatically populate validFrom and validTo. Have a look at this thread CAP Temporal Data with NodeJS
I would also be interested to hear what standard behavior you would expect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin,
i would expect the service to return all entries valid as of now (entries with empty validTo). If i understand the cap documentation correctly this should be the case:
As-of-now Queries
READ requests without specifying any temporal query parameter will automatically return data valid as of now.
GET Employees?
$expand=jobs($select=role&$expand=dept($select=name))
Source: https://cap.cloud.sap/docs/guides/temporal-data
Do i understand this correctly?
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.