Closed
Description
Newlines and extra whitespace are collapsed into single spaces within sql string literals. When running INSERT or UPDATE statements through Niceql - as with the pg_adapter_with_nicesql
option - can lead to data corruption.
Example:
[2] pry(main)> Niceql::Prettifier.prettify_sql("select 'foo\nbar baz'")
=> "select \e[0;36;49m'foo bar baz'\e[0m"
I think the bug is likely here: https://github.com/alekseyl/niceql/blob/master/lib/niceql.rb#L129
I apologize that I don't have time to contribute a bug fix PR.
Without a fix, I don't think pg_adapter_with_nicesql
can be used safely even in development.
Metadata
Metadata
Assignees
Labels
No labels