cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Initial data support for text fields containing newlines

hschaefer123
Participant
519

I am referring to URL:

https://cap.cloud.sap/docs/guides/databases?q=data+csv#providing-initial-data

Please get back to me on the following feedback:

For performance reasons, I am trying to import formerly exported/converted sqlite3 mock data
(generated from xml inside init.js)
to `data/TABLE.csv`. using plain tools

cds deploy srv --to sqlite:bme.db --no-savesqlite3 -header -csv bme.db \"select * from ns_Product;\" > ns-Product.csv

The current showstopper is the missing support for text properties containing newlines, because the `cds-deploy.js` can not handle it and throws an error.

But the official text/csv spec seems to support it
https://www.rfc-editor.org/rfc/rfc4180

escaped = DQUOTE *(TEXTDATA / COMMA / CR / LF / 2DQUOTE) DQUOTE

And this is also the way, sqlite3 exports the CSV from an existing table.

Is there maybe another way off adding text with newlines to initial mock data using CSV files (special escape sequence, etc)?

If there is no other way to handle it, any change to get support for this feature request?
I think, it would be a benefit, if CAP would could support this for initial data out-of-the-box.

Right know, i played some hours with workarounds, but none really fits my needs ;-(

Best Regards
Holger

Accepted Solutions (0)

Answers (0)