Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite: While inserting data from CSV error occurs because of case sensitivity #1003

Open
tihollinger opened this issue Jan 29, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@tihollinger
Copy link

Description of erroneous behaviour

We have an imported CDS from remote service, where the keys are named like: PartnerFunction and SDDocument. When configuring a CSV for mock data, we have wirrten the column names in capital letters like: PARTNERFUNCTION and SDDOCUMENT.
The insert fails because of a wrong sql query.
I have debugged the coding and found this place:

Image
In line 744 the function filters out all elements where the name is not included in the keys. In our case the keys are PartnerFunction, SDDocument and the respective names of elements from managed are capital letters: PARTNERFUNCTION, SDDOCUMENT. As the includes function is case sensitive, it filters out all elements and the constant extractedKeys is empty. This leads then to a falsy sql statement created at line 751.

Would it be possible to make these checks case insensitive by transforming it to capital letters for example.

Detailed steps to reproduce

If you need one, I can create a simple project, but the case was described above.

Details about your project

Your Project Name https://github.com/your/repo
@cap-js/db-service 1.17.0
@cap-js/sqlite 1.8.0
@sap/cds 8.7.0
@sap/cds-compiler 5.2.0
@sap/cds-dk 8.7.0
@sap/cds-fiori 1.3.0
@sap/cds-foss 5.0.1
@sap/cds-hana 2.0.0
Node.js v20.18.2

Run cds v -i in your project root to generate this

@tihollinger tihollinger added the bug Something isn't working label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant