Closed fedefernandez closed 7 years ago
A Printer is just a trait that transforms a String into a String, as shown here: https://github.com/frees-io/freestyle-cassandra/blob/c4ed44a04eb0f30bf8871a0286fb0faf8626e0c8/core/src/main/scala/query/query.scala#L29-L31
Printer
trait
String
We currently have a FieldLister that provides a way to list the column names for a case class: https://github.com/frees-io/freestyle-cassandra/blob/bd02435fd222e9ac970d40a42690e87d167def89/core/src/main/scala/query/FieldLister.scala#L23-L25
We need to refactor it to make use of an implicit Printer instead of using the actual case class field name here: https://github.com/frees-io/freestyle-cassandra/blob/bd02435fd222e9ac970d40a42690e87d167def89/core/src/main/scala/query/FieldLister.scala#L31
case class
We also need to adapt Unit Tests to this new implementation. The tests are located here: https://github.com/frees-io/freestyle-cassandra/blob/65876ad1db93dd3b814f1bb8015f8b68c5036d2f/core/src/test/scala/query/StatementGeneratorSpec.scala#L31-L80
An example of the behavior we are looking for can be found here: https://github.com/frees-io/freestyle-cassandra/blob/c4ed44a04eb0f30bf8871a0286fb0faf8626e0c8/core/src/main/scala/query/mapper/ByteBufferToField.scala#L38-L54
A
Printer
is just atrait
that transforms aString
into aString
, as shown here: https://github.com/frees-io/freestyle-cassandra/blob/c4ed44a04eb0f30bf8871a0286fb0faf8626e0c8/core/src/main/scala/query/query.scala#L29-L31We currently have a FieldLister that provides a way to list the column names for a case class: https://github.com/frees-io/freestyle-cassandra/blob/bd02435fd222e9ac970d40a42690e87d167def89/core/src/main/scala/query/FieldLister.scala#L23-L25
We need to refactor it to make use of an implicit
Printer
instead of using the actualcase class
field name here: https://github.com/frees-io/freestyle-cassandra/blob/bd02435fd222e9ac970d40a42690e87d167def89/core/src/main/scala/query/FieldLister.scala#L31We also need to adapt Unit Tests to this new implementation. The tests are located here: https://github.com/frees-io/freestyle-cassandra/blob/65876ad1db93dd3b814f1bb8015f8b68c5036d2f/core/src/test/scala/query/StatementGeneratorSpec.scala#L31-L80
An example of the behavior we are looking for can be found here: https://github.com/frees-io/freestyle-cassandra/blob/c4ed44a04eb0f30bf8871a0286fb0faf8626e0c8/core/src/main/scala/query/mapper/ByteBufferToField.scala#L38-L54