Adding line breaks to sqlite text

Hello, i'm trying to add a text field into my database that can have line breaks. According to what i've found on SO i can't insert escaped line breaks like "\n". I'm trying to replace the "\n" with char(10) with sql templates and sql.raw, but nothing that i've tried seems to work. https://stackoverflow.com/questions/47227684/how-to-insert-a-new-line-n-character-in-sqlite Is this possible? Any help would be greatly appreciated.
Stack Overflow
How to insert a new line ("\n") character in SQLite?
While trying to insert something like: "Hello\nWorld" SQLite throws error something like: Message: unrecognized token: "'Hello";" (also few other errors) Even though I convert above string ...
No description
2 Replies
francis
francisā€¢9mo ago
does that not just work? you can't insert line break escape sequences in the string you send to sqlite but that's not happening here - the unescaping is happening at the js interpreter level for the most obvious demonstration:
āžœ future git:(develop) āœ— node
Welcome to Node.js v18.19.0.
Type ".help" for more information.
> "\n".length
1
āžœ future git:(develop) āœ— node
Welcome to Node.js v18.19.0.
Type ".help" for more information.
> "\n".length
1
oscarina
oscarinaOPā€¢9mo ago
well... this is awkward, you are completely right i was't displaying it properly on the html (white-space: pre-grap) šŸ¤¦ā€ā™‚ļø thanks a lot for the help
Want results from more Discord servers?
Add your server