Closed
Description
If a query contains whitespace and a margin character (|
by default) right behind a codec, the whitespace along with the character will be removed.
We have fixed this locally via:
val hd = fa.parts.headOption
val tl = fa.parts.tail
val hdFmt = hd.map(
_.bimap(
_.stripMargin,
_.map(_.stripMargin)
)
)
val tlFmt = tl.map(
_.bimap(
str => str.takeWhile(_ != '\n') + str.dropWhile(_ != '\n').stripMargin,
_.map(str => str.takeWhile(_ != '\n') + str.dropWhile(_ != '\n').stripMargin)
)
)
fa.copy(parts = hdFmt.toList ++ tlFmt)
Furthermore, the stripMargin
function also removes newlines, which is not the behavior of String
's stripMargin
.
This causes problems when skunk tries to show where an error occurs when the text is wrapped:
The removal of newlines makes big queries particularly difficult to debug.
Metadata
Metadata
Assignees
Labels
No labels