Join GitHub today
Tuple-based Tables.scala file generated by Codegen does not compile #1054
I'm playing with slick 2 and codegen, using MySql for the database. I started with the Coffee / Suppliers example from the hello slick activator template.
I'm trying to use codegen to create a new Tables.scala file from the Coffee and Suppliers database tables, which will allow the existing client code to work e.g.
I've been posting to the slick google group for help. I've had to use a custom generator to use tuples for the rows instead of case classes:
This generates the following code for Tables.scala (relevant parts shown only):
This results in the following compilation errors:
I've been advised on the forum to raise this as a bug against CodeGenerator, and that I could disable the PlainSqlMapper as follows:
Disabling the PlainSqlMapper as above removes the first compilation error, but not those connected with the incorrect definitions of the * and ? methods, so it still won't compile.
I know I can fix this code by hand, but obviously codegen should produce the correctly compiling code!
(As an aside, I also wonder why the default behaviour of the code generator is to create Tables.scala with case classes; will this change in future to generate the tuples only version, so that the existing way of populating the database works with the schema classes generated by codegen?)