Skip to content

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

Open
@tihollinger

Description

@tihollinger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions