Hi and thank you for this amazing library!
In my application I have built a layer that takes some parameters (like order by, offset, limit) and builds out a Fragment with the full SQL query from them. A lightweight SQL DSL if you will.
My problem is with writing tests for this - I can test something like this:
req.whereColumnFragment.toString shouldBe Fragment.const("column = ?").toString
but, I can not test that the placeholder has been properly passed in. I would like to do something like:
val abc = "abc"
val correct = fr"column = $abc"
req.whereColumnFragment.placeholders.head shouldBe correct.placeholders.head
Here placeholders is essentially equivalent to the protected def a: A on the
Fragment sealed trait.
Problem is that it is protected so I can only access it from tests using reflection.
Hi and thank you for this amazing library!
In my application I have built a layer that takes some parameters (like order by, offset, limit) and builds out a
Fragmentwith the full SQL query from them. A lightweight SQL DSL if you will.My problem is with writing tests for this - I can test something like this:
but, I can not test that the placeholder has been properly passed in. I would like to do something like:
Here
placeholdersis essentially equivalent to theprotected def a: Aon theFragmentsealed trait.Problem is that it is
protectedso I can only access it from tests using reflection.