-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
Description of erroneous behaviour
I have the following CAP db model
entity Calculations : cuid, managed {
calculatedOn : Date;
}
In my TypeScript Code I want to run the following UPDATE
query
await UPDATE(Calculations, id).set({ calculatedOn: new Date() })
The update query is executed without issues, but afterwards, a SELECT
on the updated row shows the following output
{
"ID": "382fee26-370d-40d2-bd58-49faedc76faf",
"calculatedOn": "2025-01-29T08:56:53.117Z"
}
instead of
{
"ID": "382fee26-370d-40d2-bd58-49faedc76faf",
"calculatedOn": "2025-01-29"
}
With @cap-js/sqlite
and version <= 1.7.4 this automatic conversion still works. The behavior changed in 338e9f5. As the current implementation of @cap-js/hana
still performs the conversion/cut-off during UPDATE
I would expect the SQlite driver to behave the same way.
Detailed steps to reproduce
For example (→ replace by appropriate ones for your case):
- git clone https://github.com/stockbal/sqlite-issue-test
- npm ci
- npm run watch
Details about your project
Project | https://github.com/stockbal/sqlite-issue-test |
---|---|
OData version | v4 |
Node.js version | v20.18.1 |
@sap/cds | 8.7.0 |
@sap/cds-compiler | 5.7.0 |
@sap/cds-dk | 8.7.0 |
@cap-js/sqlite | 1.7.8 |