From dede1ad097428edfc999bc0add6b4cfe7c0f666b Mon Sep 17 00:00:00 2001 From: sviezypan Date: Thu, 19 Jan 2023 23:38:10 +0100 Subject: [PATCH 1/5] support select * from --- core/jvm/src/main/scala/zio/sql/Sql.scala | 1 + .../src/main/scala/zio/sql/allcolumns.scala | 428 ++++++++++++++++++ .../src/main/scala/zio/sql/selectutils.scala | 28 +- core/jvm/src/main/scala/zio/sql/table.scala | 10 +- .../src/main/scala/zio/sql/Examples.scala | 4 + .../postgresql/PostgresSqlModuleSpec.scala | 9 + 6 files changed, 478 insertions(+), 2 deletions(-) create mode 100644 core/jvm/src/main/scala/zio/sql/allcolumns.scala diff --git a/core/jvm/src/main/scala/zio/sql/Sql.scala b/core/jvm/src/main/scala/zio/sql/Sql.scala index 68ce9f141..6c8e7e16f 100644 --- a/core/jvm/src/main/scala/zio/sql/Sql.scala +++ b/core/jvm/src/main/scala/zio/sql/Sql.scala @@ -8,6 +8,7 @@ trait Sql with UpdateModule with ExprModule with TableModule + with AllColumnsModule with InsertModule with UtilsModule with SelectUtilsModule diff --git a/core/jvm/src/main/scala/zio/sql/allcolumns.scala b/core/jvm/src/main/scala/zio/sql/allcolumns.scala new file mode 100644 index 000000000..8f65d5bc0 --- /dev/null +++ b/core/jvm/src/main/scala/zio/sql/allcolumns.scala @@ -0,0 +1,428 @@ +package zio.sql + +import scala.annotation.implicitNotFound + +trait AllColumnsModule { self: SelectModule with ExprModule => + + @implicitNotFound("SELECT * not supported for table of this size") + sealed trait ColumnsHelper[ColumnsOut, TableType] { + type F + type SelSet <: SelectionSet[TableType] + type ResultTypeRepr + type ColumnHead + type SelectionTail <: SelectionSet[TableType] + + def apply(columns: ColumnsOut): SelectBuilder[F, TableType, SelSet] + } + + // format: off + object ColumnsHelper { + + type Aux[ColumnsOut0, TableType0, F0, SelectionSet0, ResultTypeRepr0, ColumnsHead0, SelectionTail0] = + ColumnsHelper[ColumnsOut0, TableType0] { + type F = F0 + + type SelSet = SelectionSet0 + + type ResultTypeRepr = ResultTypeRepr0 + type ColumnHead = ColumnsHead0 + type SelectionTail = SelectionTail0 + } + + implicit def instance1[F1, TableType, A1]: ColumnsHelper.Aux[Expr[ + F1, + TableType, + A1 + ], TableType, F1, SelectionSet.Cons[TableType, A1, SelectionSet.Empty], A1, A1, SelectionSet.Empty] = + new ColumnsHelper[Expr[F1, TableType, A1], TableType] { + + override type F = F1 + override type SelSet = SelectionSet.Cons[TableType, A1, SelectionSet.Empty] + + override type ResultTypeRepr = A1 + + override type ColumnHead = A1 + override type SelectionTail = SelectionSet.Empty + + override def apply(columns: Expr[F1, TableType, A1]) = + SelectBuilder[F1, TableType, SelectionSet.Cons[TableType, A1, SelectionSet.Empty]](columns) + } + + implicit def instance2[F1, F2, TableType, A1, A2] + : ColumnsHelper.Aux[(Expr[F1, TableType, A1], Expr[F2, TableType, A2]), TableType, F1 with F2, SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Empty] + ], (A1, A2), A1, SelectionSet.Cons[TableType, A2, SelectionSet.Empty]] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2]), TableType] { + + override type F = F1 with F2 + override type SelSet = SelectionSet.Cons[TableType, A1, SelectionSet.Cons[TableType, A2, SelectionSet.Empty]] + + override type ResultTypeRepr = (A1, A2) + + override type ColumnHead = A1 + override type SelectionTail = SelectionSet.Cons[TableType, A2, SelectionSet.Empty] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2])) = { + val selection = columns._1 ++ columns._2 + + SelectBuilder[ + F1 with F2, + TableType, + SelectionSet.Cons[TableType, A1, SelectionSet.Cons[TableType, A2, SelectionSet.Empty]] + ](selection) + } + } + + implicit def instance3[F1, F2, F3, TableType, A1, A2, A3]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3]), + TableType, + F1 with F2 with F3, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Empty]] + ], + (A1, A2, A3), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Empty]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3]), TableType] { + + override type F = F1 with F2 with F3 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Empty]] + ] + + override type ResultTypeRepr = (A1, A2, A3) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Empty]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 + + SelectBuilder[ + F1 with F2 with F3, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Empty]] + ] + ](selection) + } + } + + + implicit def instance4[F1, F2, F3, F4, TableType, A1, A2, A3, A4]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4]), + TableType, + F1 with F2 with F3 with F4, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Empty]]] + ], + (A1, A2, A3, A4), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Empty]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4]), TableType] { + + override type F = F1 with F2 with F3 with F4 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Empty]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Empty]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 + + SelectBuilder[ + F1 with F2 with F3 with F4, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Empty]]] + ] + ](selection) + } + } + + implicit def instance5[F1, F2, F3, F4, F5, TableType, A1, A2, A3, A4, A5]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5]), + TableType, + F1 with F2 with F3 with F4 with F5, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Empty]]]] + ], + (A1, A2, A3, A4, A5), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Empty]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Empty]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Empty]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Empty]]]] + ] + ](selection) + } + } + + implicit def instance6[F1, F2, F3, F4, F5, F6, TableType, A1, A2, A3, A4, A5, A6]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Empty]]]]] + ], + (A1, A2, A3, A4, A5, A6), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Empty]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Empty]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Empty]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Empty]]]]] + ] + ](selection) + } + } + + implicit def instance7[F1, F2, F3, F4, F5, F6, F7, TableType, A1, A2, A3, A4, A5, A6, A7]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Empty]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Empty]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Empty]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Empty]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Empty]]]]]] + ] + ](selection) + } + } + + implicit def instance8[F1, F2, F3, F4, F5, F6, F7, F8, TableType, A1, A2, A3, A4, A5, A6, A7, A8]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Empty]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Empty]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Empty]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Empty]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Empty]]]]]]] + ] + ](selection) + } + } + + implicit def instance9[F1, F2, F3, F4, F5, F6, F7, F8, F9, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Empty]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Empty]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Empty]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Empty]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Empty]]]]]]]] + ] + ](selection) + } + } + + + implicit def instance10[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Empty]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Empty]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Empty]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Empty]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Empty]]]]]]]]] + ] + ](selection) + } + } + + // TODO add more arities or rewrite to macro of possible + } + // format: on + +} diff --git a/core/jvm/src/main/scala/zio/sql/selectutils.scala b/core/jvm/src/main/scala/zio/sql/selectutils.scala index 9df2c7841..9c33a3d70 100644 --- a/core/jvm/src/main/scala/zio/sql/selectutils.scala +++ b/core/jvm/src/main/scala/zio/sql/selectutils.scala @@ -1,9 +1,35 @@ package zio.sql // format: off -trait SelectUtilsModule { self: TableModule with ExprModule with InsertModule with SelectModule => +trait SelectUtilsModule { self: TableModule with ExprModule with InsertModule with SelectModule with AllColumnsModule => + + sealed case class SelectAll() { + + def from[A](table: Table.Source.Aux[A])(implicit helper: ColumnsHelper[table.ColumnsOut, A]): Read.Select[ + helper.F, + helper.ResultTypeRepr, + A, + helper.ColumnHead, + helper.SelectionTail + ] = { + type B0 = SelectionSet.ConsAux[ + helper.ResultTypeRepr, + A, + helper.ColumnHead, + helper.SelectionTail + ] + val b: B0 = table.*.selection.value.asInstanceOf[B0] + + Read.Subselect[helper.F, helper.ResultTypeRepr, A, A, helper.ColumnHead, helper.SelectionTail]( + Selection[helper.F, A, B0](b), Some(table), true + ) + } + } sealed case class SelectByCommaBuilder() { + + def * : SelectAll = SelectAll() + def apply[F1, Source, B1](expr1: Expr[F1, Source, B1]) = { SelectBuilder[F1, Source, SelectionSet.Cons[Source, B1, SelectionSet.Empty]](expr1) } diff --git a/core/jvm/src/main/scala/zio/sql/table.scala b/core/jvm/src/main/scala/zio/sql/table.scala index bd3a99f0a..008f582c0 100644 --- a/core/jvm/src/main/scala/zio/sql/table.scala +++ b/core/jvm/src/main/scala/zio/sql/table.scala @@ -10,7 +10,7 @@ object TableAnnotation { case class name(name: String) extends StaticAnnotation } -trait TableModule { self: ExprModule with SelectModule with UtilsModule with SelectUtilsModule => +trait TableModule { self: ExprModule with SelectModule with UtilsModule with SelectUtilsModule with AllColumnsModule => type Lens[F, S, A] = Expr[Features.Source[F, S], S, A] @@ -22,6 +22,7 @@ trait TableModule { self: ExprModule with SelectModule with UtilsModule with Sel * Creates a table descripton from the Schema of T. * Table name is taken either from @name annotation or schema id type and pluralized. */ + // TODO do not allow CaseClass0 with macro def defineTableSmart[T](implicit schema: Schema.Record[T], tableLike: TableSchema[T] @@ -78,6 +79,11 @@ trait TableModule { self: ExprModule with SelectModule with UtilsModule with Sel override val columns: ColumnsOut = schema.makeAccessors(exprAccessorBuilder) + override def *(implicit + helper: ColumnsHelper[ColumnsOut, TableType] + ): SelectBuilder[helper.F, TableType, helper.SelSet] = + helper.apply(columns) + override val name: TableName = tableName.toLowerCase() } @@ -221,6 +227,8 @@ trait TableModule { self: ExprModule with SelectModule with UtilsModule with Sel val columns: ColumnsOut + def *(implicit helper: ColumnsHelper[ColumnsOut, TableType]): SelectBuilder[helper.F, TableType, helper.SelSet] + override def ahhhhhhhhhhhhh[A]: A = ??? // don't remove or it'll break } diff --git a/examples/src/main/scala/zio/sql/Examples.scala b/examples/src/main/scala/zio/sql/Examples.scala index d601b000c..5b7ddd5ef 100644 --- a/examples/src/main/scala/zio/sql/Examples.scala +++ b/examples/src/main/scala/zio/sql/Examples.scala @@ -18,6 +18,10 @@ object Examples extends App with PostgresJdbcModule { println(renderRead(basicSelect)) + val selectAll1 = select.*.from(orderDetails) + val selectAll2 = select.*.from(users) + val selectAll3 = select.*.from(orders) + // SELECT "users"."age" + 2, concat_ws("users"."first_name",' ',"users"."last_name"), abs(-42.0) FROM "users" ORDER BY "users"."age" DESC LIMIT 10 OFFSET 20 val selectWithFunctions = select(age + 2, ConcatWs3(fName, " ", lName), Abs(-42.0)) diff --git a/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala index 813102f77..b25dae978 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala @@ -687,6 +687,15 @@ object PostgresSqlModuleSpec extends PostgresRunnableSpec with DbSchema { for { result <- execute(update(persons).set(personsName, Some("Charlie")).where(personsName === Some("Murray"))) } yield assertTrue(result == 1) + }, + test("select all rows") { + import CustomerSchema._ + + val query = select.*.from(customers) + + for { + result <- execute(query).runCollect + } yield assertTrue(result.length == 2) } ) @@ sequential } From db336802cbf571341329e0150c8eb548def93c39 Mon Sep 17 00:00:00 2001 From: sviezypan Date: Mon, 13 Feb 2023 09:22:36 +0100 Subject: [PATCH 2/5] added more aritites --- core/jvm/src/main/scala/zio/sql/Sql.scala | 8 + .../src/main/scala/zio/sql/allcolumns.scala | 519 +++++++++++++++++- core/jvm/src/main/scala/zio/sql/select.scala | 8 +- .../src/main/scala/zio/sql/selectutils.scala | 4 +- core/jvm/src/main/scala/zio/sql/table.scala | 24 +- .../src/main/scala/zio/sql/Examples.scala | 10 +- .../scala-2/zio/sql/macros/Normalizer.scala | 43 ++ .../scala-2/zio/sql/macros/insertlike.scala | 2 +- .../scala-3/zio/sql/macros/normalizer.scala | 21 + .../postgresql/PostgresSqlModuleSpec.scala | 2 +- 10 files changed, 613 insertions(+), 28 deletions(-) create mode 100644 macros/src/main/scala-2/zio/sql/macros/Normalizer.scala create mode 100644 macros/src/main/scala-3/zio/sql/macros/normalizer.scala diff --git a/core/jvm/src/main/scala/zio/sql/Sql.scala b/core/jvm/src/main/scala/zio/sql/Sql.scala index 6c8e7e16f..6dafbd36e 100644 --- a/core/jvm/src/main/scala/zio/sql/Sql.scala +++ b/core/jvm/src/main/scala/zio/sql/Sql.scala @@ -29,6 +29,14 @@ trait Sql */ val select: SelectByCommaBuilder = SelectByCommaBuilder() + sealed trait Star + val * : Star = new Star {} + + def select(star: Star): SelectAll = { + val _ = star + new SelectAll() + } + def select[F, A, B <: SelectionSet[A]](selection: Selection[F, A, B]): SelectBuilder[F, A, B] = SelectBuilder[F, A, B](selection) diff --git a/core/jvm/src/main/scala/zio/sql/allcolumns.scala b/core/jvm/src/main/scala/zio/sql/allcolumns.scala index 8f65d5bc0..2ff435069 100644 --- a/core/jvm/src/main/scala/zio/sql/allcolumns.scala +++ b/core/jvm/src/main/scala/zio/sql/allcolumns.scala @@ -4,7 +4,7 @@ import scala.annotation.implicitNotFound trait AllColumnsModule { self: SelectModule with ExprModule => - @implicitNotFound("SELECT * not supported for table of this size") + @implicitNotFound("SELECT * currently not supported on joined tables, derived tables and for table of size bigger than 22.") sealed trait ColumnsHelper[ColumnsOut, TableType] { type F type SelSet <: SelectionSet[TableType] @@ -421,7 +421,522 @@ trait AllColumnsModule { self: SelectModule with ExprModule => } } - // TODO add more arities or rewrite to macro of possible + implicit def instance11[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Empty]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Empty]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Empty]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Empty]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Empty]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance12[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Empty]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Empty]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Empty]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Empty]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Empty]]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance13[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Empty]]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Empty]]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Empty]]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Empty]]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 ++ columns._13 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Empty]]]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance14[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Empty]]]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Empty]]]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Empty]]]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Empty]]]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 ++ columns._13 ++ columns._14 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Empty]]]]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance15[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Empty]]]]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Empty]]]]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Empty]]]]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Empty]]]]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 ++ columns._13 ++ columns._14 ++ columns._15 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Empty]]]]]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance16[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Empty]]]]]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Empty]]]]]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Empty]]]]]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Empty]]]]]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 ++ columns._13 ++ columns._14 ++ columns._15 ++ columns._16 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Empty]]]]]]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance17[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Empty]]]]]]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Empty]]]]]]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Empty]]]]]]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Empty]]]]]]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 ++ columns._13 ++ columns._14 ++ columns._15 ++ columns._16 ++ columns._17 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Empty]]]]]]]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance18[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Empty]]]]]]]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Empty]]]]]]]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Empty]]]]]]]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Empty]]]]]]]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 ++ columns._13 ++ columns._14 ++ columns._15 ++ columns._16 ++ columns._17 ++ columns._18 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Empty]]]]]]]]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance19[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Empty]]]]]]]]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Empty]]]]]]]]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Empty]]]]]]]]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Empty]]]]]]]]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 ++ columns._13 ++ columns._14 ++ columns._15 ++ columns._16 ++ columns._17 ++ columns._18 ++ columns._19 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Empty]]]]]]]]]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance20[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19], Expr[F20, TableType, A20]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19 with F20, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Empty]]]]]]]]]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Empty]]]]]]]]]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19], Expr[F20, TableType, A20]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19 with F20 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Empty]]]]]]]]]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Empty]]]]]]]]]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19], Expr[F20, TableType, A20])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 ++ columns._13 ++ columns._14 ++ columns._15 ++ columns._16 ++ columns._17 ++ columns._18 ++ columns._19 ++ columns._20 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19 with F20, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Empty]]]]]]]]]]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance21[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19], Expr[F20, TableType, A20], Expr[F21, TableType, A21]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19 with F20 with F21, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Cons[TableType, A21, SelectionSet.Empty]]]]]]]]]]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Cons[TableType, A21, SelectionSet.Empty]]]]]]]]]]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19], Expr[F20, TableType, A20], Expr[F21, TableType, A21]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19 with F20 with F21 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Cons[TableType, A21, SelectionSet.Empty]]]]]]]]]]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Cons[TableType, A21, SelectionSet.Empty]]]]]]]]]]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19], Expr[F20, TableType, A20], Expr[F21, TableType, A21])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 ++ columns._13 ++ columns._14 ++ columns._15 ++ columns._16 ++ columns._17 ++ columns._18 ++ columns._19 ++ columns._20 ++ columns._21 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19 with F20 with F21, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Cons[TableType, A21, SelectionSet.Empty]]]]]]]]]]]]]]]]]]]] + ] + ](selection) + } + } + + implicit def instance22[F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, TableType, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22]: ColumnsHelper.Aux[ + (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19], Expr[F20, TableType, A20], Expr[F21, TableType, A21], Expr[F22, TableType, A22]), + TableType, + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19 with F20 with F21 with F22, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Cons[TableType, A21, SelectionSet.Cons[TableType, A22, SelectionSet.Empty]]]]]]]]]]]]]]]]]]]]] + ], + (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22), + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Cons[TableType, A21, SelectionSet.Cons[TableType, A22, SelectionSet.Empty]]]]]]]]]]]]]]]]]]]]] + ] = + new ColumnsHelper[(Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19], Expr[F20, TableType, A20], Expr[F21, TableType, A21], Expr[F22, TableType, A22]), TableType] { + + override type F = F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19 with F20 with F21 with F22 + override type SelSet = SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10,SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Cons[TableType, A21, SelectionSet.Cons[TableType, A22, SelectionSet.Empty]]]]]]]]]]]]]]]]]]]]] + ] + + override type ResultTypeRepr = (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22) + + override type ColumnHead = A1 + override type SelectionTail = + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Cons[TableType, A21, SelectionSet.Cons[TableType, A22, SelectionSet.Empty]]]]]]]]]]]]]]]]]]]]] + + override def apply(columns: (Expr[F1, TableType, A1], Expr[F2, TableType, A2], Expr[F3, TableType, A3], Expr[F4, TableType, A4], Expr[F5, TableType, A5], Expr[F6, TableType, A6], Expr[F7, TableType, A7], Expr[F8, TableType, A8], Expr[F9, TableType, A9], Expr[F10, TableType, A10], Expr[F11, TableType, A11], Expr[F12, TableType, A12], Expr[F13, TableType, A13], Expr[F14, TableType, A14], Expr[F15, TableType, A15], Expr[F16, TableType, A16], Expr[F17, TableType, A17], Expr[F18, TableType, A18], Expr[F19, TableType, A19], Expr[F20, TableType, A20], Expr[F21, TableType, A21], Expr[F22, TableType, A22])) = { + val selection = columns._1 ++ columns._2 ++ columns._3 ++ columns._4 ++ columns._5 ++ columns._6 ++ columns._7 ++ columns._8 ++ columns._9 ++ columns._10 ++ columns._11 ++ columns._12 ++ columns._13 ++ columns._14 ++ columns._15 ++ columns._16 ++ columns._17 ++ columns._18 ++ columns._19 ++ columns._20 ++ columns._21 ++ columns._22 + + SelectBuilder[ + F1 with F2 with F3 with F4 with F5 with F6 with F7 with F8 with F9 with F10 with F11 with F12 with F13 with F14 with F15 with F16 with F17 with F18 with F19 with F20 with F21 with F22, + TableType, + SelectionSet.Cons[ + TableType, + A1, + SelectionSet.Cons[TableType, A2, SelectionSet.Cons[TableType, A3, SelectionSet.Cons[TableType, A4, SelectionSet.Cons[TableType, A5, SelectionSet.Cons[TableType, A6, SelectionSet.Cons[TableType, A7, SelectionSet.Cons[TableType, A8, SelectionSet.Cons[TableType, A9, SelectionSet.Cons[TableType, A10, SelectionSet.Cons[TableType, A11, SelectionSet.Cons[TableType, A12, SelectionSet.Cons[TableType, A13, SelectionSet.Cons[TableType, A14, SelectionSet.Cons[TableType, A15, SelectionSet.Cons[TableType, A16, SelectionSet.Cons[TableType, A17, SelectionSet.Cons[TableType, A18, SelectionSet.Cons[TableType, A19, SelectionSet.Cons[TableType, A20, SelectionSet.Cons[TableType, A21, SelectionSet.Cons[TableType, A22, SelectionSet.Empty]]]]]]]]]]]]]]]]]]]]] + ] + ](selection) + } + } + } // format: on diff --git a/core/jvm/src/main/scala/zio/sql/select.scala b/core/jvm/src/main/scala/zio/sql/select.scala index 2e9726396..7cabd40c5 100644 --- a/core/jvm/src/main/scala/zio/sql/select.scala +++ b/core/jvm/src/main/scala/zio/sql/select.scala @@ -9,7 +9,7 @@ trait SelectModule { self: ExprModule with TableModule with UtilsModule => def from[Source0 <: Source](table: Table.Aux[Source0])(implicit ev: B <:< SelectionSet.Cons[Source0, selection.value.ColumnHead, selection.value.SelectionTail], - normalizer: TrailingUnitNormalizer[selection.value.ResultTypeRepr] + normalizer: Normalizer[selection.value.ResultTypeRepr] ): Read.Select[ F0, normalizer.Out, @@ -39,7 +39,7 @@ trait SelectModule { self: ExprModule with TableModule with UtilsModule => builder.selection.value.ColumnHead, builder.selection.value.SelectionTail ], - normalizer: TrailingUnitNormalizer[builder.selection.value.ResultTypeRepr] + normalizer: Normalizer[builder.selection.value.ResultTypeRepr] ): Read.Select[ F, normalizer.Out, @@ -65,7 +65,7 @@ trait SelectModule { self: ExprModule with TableModule with UtilsModule => def from[Source0](table: Table.Aux[Source0])(implicit ev1: Source0 with ParentTable <:< Source, ev2: B <:< SelectionSet.Cons[Source, selection.value.ColumnHead, selection.value.SelectionTail], - normalizer: TrailingUnitNormalizer[selection.value.ResultTypeRepr] + normalizer: Normalizer[selection.value.ResultTypeRepr] ): Read.Subselect[ F, normalizer.Out, @@ -297,7 +297,7 @@ trait SelectModule { self: ExprModule with TableModule with UtilsModule => //format: on def normalize(implicit - instance: TrailingUnitNormalizer[ResultType] + instance: Normalizer[ResultType] ): Subselect[F, instance.Out, Source, Subsource, Head, Tail] = self.asInstanceOf[Subselect[F, instance.Out, Source, Subsource, Head, Tail]] diff --git a/core/jvm/src/main/scala/zio/sql/selectutils.scala b/core/jvm/src/main/scala/zio/sql/selectutils.scala index 9c33a3d70..71e0aa681 100644 --- a/core/jvm/src/main/scala/zio/sql/selectutils.scala +++ b/core/jvm/src/main/scala/zio/sql/selectutils.scala @@ -18,7 +18,7 @@ trait SelectUtilsModule { self: TableModule with ExprModule with InsertModule wi helper.ColumnHead, helper.SelectionTail ] - val b: B0 = table.*.selection.value.asInstanceOf[B0] + val b: B0 = table.all.selection.value.asInstanceOf[B0] Read.Subselect[helper.F, helper.ResultTypeRepr, A, A, helper.ColumnHead, helper.SelectionTail]( Selection[helper.F, A, B0](b), Some(table), true @@ -28,8 +28,6 @@ trait SelectUtilsModule { self: TableModule with ExprModule with InsertModule wi sealed case class SelectByCommaBuilder() { - def * : SelectAll = SelectAll() - def apply[F1, Source, B1](expr1: Expr[F1, Source, B1]) = { SelectBuilder[F1, Source, SelectionSet.Cons[Source, B1, SelectionSet.Empty]](expr1) } diff --git a/core/jvm/src/main/scala/zio/sql/table.scala b/core/jvm/src/main/scala/zio/sql/table.scala index 008f582c0..11775ca02 100644 --- a/core/jvm/src/main/scala/zio/sql/table.scala +++ b/core/jvm/src/main/scala/zio/sql/table.scala @@ -68,18 +68,18 @@ trait TableModule { self: ExprModule with SelectModule with UtilsModule with Sel ): Table.Source.WithTableDetails[schema.Terms, T, schema.Accessors[Lens, Prism, Traversal]] = new Table.Source { - val exprAccessorBuilder = new ExprAccessorBuilder(tableName) + protected[sql] val exprAccessorBuilder = new ExprAccessorBuilder(tableName) - override type AllColumnIdentities = schema.Terms + override protected[sql] type AllColumnIdentities = schema.Terms - override type TableType = T + override protected[sql] type TableType = T - override type ColumnsOut = + override protected[sql] type ColumnsOut = schema.Accessors[exprAccessorBuilder.Lens, exprAccessorBuilder.Prism, exprAccessorBuilder.Traversal] override val columns: ColumnsOut = schema.makeAccessors(exprAccessorBuilder) - override def *(implicit + override protected[sql] def all(implicit helper: ColumnsHelper[ColumnsOut, TableType] ): SelectBuilder[helper.F, TableType, helper.SelSet] = helper.apply(columns) @@ -183,7 +183,7 @@ trait TableModule { self: ExprModule with SelectModule with UtilsModule with Sel } sealed trait Table { self => - type TableType + protected[sql] type TableType final def fullOuter[That](that: Table.Aux[That]): Table.JoinBuilder[self.TableType, That] = new Table.JoinBuilder[self.TableType, That](JoinType.FullOuter, self, that) @@ -215,21 +215,23 @@ trait TableModule { self: ExprModule with SelectModule with UtilsModule with Sel } trait Insanity { - def ahhhhhhhhhhhhh[A]: A + protected[sql] def ahhhhhhhhhhhhh[A]: A } sealed trait Source extends Table with Insanity { - type AllColumnIdentities + protected[sql] type AllColumnIdentities val name: TableName - type ColumnsOut + protected[sql] type ColumnsOut val columns: ColumnsOut - def *(implicit helper: ColumnsHelper[ColumnsOut, TableType]): SelectBuilder[helper.F, TableType, helper.SelSet] + protected[sql] def all(implicit + helper: ColumnsHelper[ColumnsOut, TableType] + ): SelectBuilder[helper.F, TableType, helper.SelSet] - override def ahhhhhhhhhhhhh[A]: A = ??? // don't remove or it'll break + override protected[sql] def ahhhhhhhhhhhhh[A]: A = ??? // don't remove or it'll break } object Source { diff --git a/examples/src/main/scala/zio/sql/Examples.scala b/examples/src/main/scala/zio/sql/Examples.scala index 5b7ddd5ef..e3b0a3489 100644 --- a/examples/src/main/scala/zio/sql/Examples.scala +++ b/examples/src/main/scala/zio/sql/Examples.scala @@ -12,16 +12,14 @@ object Examples extends App with PostgresJdbcModule { import this.Orders._ import this.Users._ - // SELECT "users"."first_name", "users"."last_name" FROM "users" val basicSelect = select(fName, lName).from(users) println(renderRead(basicSelect)) - val selectAll1 = select.*.from(orderDetails) - val selectAll2 = select.*.from(users) - val selectAll3 = select.*.from(orders) - + val selectAll1 = select(*).from(orderDetails) + val selectAll2 = select(*).from(users) + // SELECT "users"."age" + 2, concat_ws("users"."first_name",' ',"users"."last_name"), abs(-42.0) FROM "users" ORDER BY "users"."age" DESC LIMIT 10 OFFSET 20 val selectWithFunctions = select(age + 2, ConcatWs3(fName, " ", lName), Abs(-42.0)) @@ -70,7 +68,7 @@ object Examples extends App with PostgresJdbcModule { /* SELECT "users"."id", "users"."first_name", "users"."last_name", sum("order_details"."quantity" * "order_details"."unit_price"), sum(abs("order_details"."quantity")) - FROM "users" + FROM "users"x INNER JOIN "orders" ON "users"."id" = "orders"."usr_id" LEFT JOIN "order_details" ON "orders"."id" = "order_details"."order_id" GROUP BY "users"."id", "users"."first_name", "users"."last_name" */ diff --git a/macros/src/main/scala-2/zio/sql/macros/Normalizer.scala b/macros/src/main/scala-2/zio/sql/macros/Normalizer.scala new file mode 100644 index 000000000..0b590cf46 --- /dev/null +++ b/macros/src/main/scala-2/zio/sql/macros/Normalizer.scala @@ -0,0 +1,43 @@ +package zio.sql.macros + +import scala.reflect.macros.whitebox +import scala.language.experimental.macros + +sealed trait Normalizer[In] { + type Out +} + +object Normalizer { + + final case class Instance[In, Out2]() extends Normalizer[In] { + override type Out = Out2 + } + + implicit def createNormalizer[In, Out]: Instance[In, Out] = macro createNormalizerImpl[In, Out] + + def createNormalizerImpl[In: c.WeakTypeTag, Out: c.WeakTypeTag]( + c: whitebox.Context + ): c.Tree = { + import c.universe._ + + val inType = weakTypeOf[In] + val _ = weakTypeOf[Out] + + + def deconstructType(t: Type): List[Type] = + t.dealias match { + case TypeRef(_, y, types) if (types != Nil && (y == symbolOf[scala.Tuple2[_, _]])) => + types.head :: deconstructType(types.tail.head) + case TypeRef(_, _, types) if (types == Nil) => + Nil + case s => + c.abort(c.enclosingPosition, s"Error ${showRaw(s)}") + } + + val values = deconstructType(inType) + val outType = tq"(..$values)" + + q"""zio.sql.macros.Normalizer.Instance[${q"$inType"}, $outType]()""" + } + +} diff --git a/macros/src/main/scala-2/zio/sql/macros/insertlike.scala b/macros/src/main/scala-2/zio/sql/macros/insertlike.scala index 57e956a16..8b510afdb 100644 --- a/macros/src/main/scala-2/zio/sql/macros/insertlike.scala +++ b/macros/src/main/scala-2/zio/sql/macros/insertlike.scala @@ -13,7 +13,7 @@ sealed trait InsertLike[F, ColsRepr, AllColumnIdentities, Z] */ object InsertLike { - // TODO check arity and if > 22 AllColumnIdentites is a nested tuple + // TODO check when arity > 22 is AllColumnIdentites is a nested tuple? final case class CanBeInserted[F, ColsRepr, AllColumnIdentities, Z]() extends InsertLike[F, ColsRepr, AllColumnIdentities, Z] diff --git a/macros/src/main/scala-3/zio/sql/macros/normalizer.scala b/macros/src/main/scala-3/zio/sql/macros/normalizer.scala new file mode 100644 index 000000000..86f30b659 --- /dev/null +++ b/macros/src/main/scala-3/zio/sql/macros/normalizer.scala @@ -0,0 +1,21 @@ +package zio.sql.macros + +import scala.reflect.macros.whitebox +import scala.language.experimental.macros + +sealed trait Normalizer[In] { + type Out +} + +// TODO transparent inline +object Normalizer { + +// final case class Instance[In, Out2]() extends Normalizer[In] { +// override type Out = Out2 +// } + + implicit def createNormalizer[In]: Normalizer[In] = { + new Normalizer[In] {} + } + +} diff --git a/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala index b25dae978..7b0ccfb19 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala @@ -691,7 +691,7 @@ object PostgresSqlModuleSpec extends PostgresRunnableSpec with DbSchema { test("select all rows") { import CustomerSchema._ - val query = select.*.from(customers) + val query = select(*).from(customers) for { result <- execute(query).runCollect From ff928db9e0d2f5a24f33ade76c8efded25a756a6 Mon Sep 17 00:00:00 2001 From: sviezypan Date: Mon, 13 Feb 2023 09:23:58 +0100 Subject: [PATCH 3/5] formatting --- core/jvm/src/main/scala/zio/sql/allcolumns.scala | 4 +++- examples/src/main/scala/zio/sql/Examples.scala | 2 +- macros/src/main/scala-2/zio/sql/macros/Normalizer.scala | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/jvm/src/main/scala/zio/sql/allcolumns.scala b/core/jvm/src/main/scala/zio/sql/allcolumns.scala index 2ff435069..ec45d0617 100644 --- a/core/jvm/src/main/scala/zio/sql/allcolumns.scala +++ b/core/jvm/src/main/scala/zio/sql/allcolumns.scala @@ -4,7 +4,9 @@ import scala.annotation.implicitNotFound trait AllColumnsModule { self: SelectModule with ExprModule => - @implicitNotFound("SELECT * currently not supported on joined tables, derived tables and for table of size bigger than 22.") + @implicitNotFound( + "SELECT * currently not supported on joined tables, derived tables and for table of size bigger than 22." + ) sealed trait ColumnsHelper[ColumnsOut, TableType] { type F type SelSet <: SelectionSet[TableType] diff --git a/examples/src/main/scala/zio/sql/Examples.scala b/examples/src/main/scala/zio/sql/Examples.scala index e3b0a3489..4fe7fb7ea 100644 --- a/examples/src/main/scala/zio/sql/Examples.scala +++ b/examples/src/main/scala/zio/sql/Examples.scala @@ -19,7 +19,7 @@ object Examples extends App with PostgresJdbcModule { val selectAll1 = select(*).from(orderDetails) val selectAll2 = select(*).from(users) - + // SELECT "users"."age" + 2, concat_ws("users"."first_name",' ',"users"."last_name"), abs(-42.0) FROM "users" ORDER BY "users"."age" DESC LIMIT 10 OFFSET 20 val selectWithFunctions = select(age + 2, ConcatWs3(fName, " ", lName), Abs(-42.0)) diff --git a/macros/src/main/scala-2/zio/sql/macros/Normalizer.scala b/macros/src/main/scala-2/zio/sql/macros/Normalizer.scala index 0b590cf46..6a8a3ad4e 100644 --- a/macros/src/main/scala-2/zio/sql/macros/Normalizer.scala +++ b/macros/src/main/scala-2/zio/sql/macros/Normalizer.scala @@ -23,12 +23,11 @@ object Normalizer { val inType = weakTypeOf[In] val _ = weakTypeOf[Out] - def deconstructType(t: Type): List[Type] = t.dealias match { case TypeRef(_, y, types) if (types != Nil && (y == symbolOf[scala.Tuple2[_, _]])) => types.head :: deconstructType(types.tail.head) - case TypeRef(_, _, types) if (types == Nil) => + case TypeRef(_, _, types) if (types == Nil) => Nil case s => c.abort(c.enclosingPosition, s"Error ${showRaw(s)}") From c60a7a2cc77ff9267623043e9e8f8e8fa6f90957 Mon Sep 17 00:00:00 2001 From: sviezypan Date: Mon, 13 Feb 2023 10:11:29 +0100 Subject: [PATCH 4/5] compilation failure --- macros/src/main/scala-3/zio/sql/macros/normalizer.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/macros/src/main/scala-3/zio/sql/macros/normalizer.scala b/macros/src/main/scala-3/zio/sql/macros/normalizer.scala index 86f30b659..a0390a141 100644 --- a/macros/src/main/scala-3/zio/sql/macros/normalizer.scala +++ b/macros/src/main/scala-3/zio/sql/macros/normalizer.scala @@ -1,6 +1,5 @@ package zio.sql.macros -import scala.reflect.macros.whitebox import scala.language.experimental.macros sealed trait Normalizer[In] { From abf0c012a42e67ff5413a7c39b9e4ec37e018f3c Mon Sep 17 00:00:00 2001 From: sviezypan Date: Mon, 13 Feb 2023 12:47:07 +0100 Subject: [PATCH 5/5] removed scala 3 from scala versions --- project/BuildHelper.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index e1e35050e..6d33d8f7f 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -147,8 +147,7 @@ object BuildHelper { def stdSettings(prjName: String) = Seq( name := s"$prjName", scalacOptions := stdOptions, - crossScalaVersions := Seq(Scala213, Scala212, ScalaDotty), - // ThisBuild / scalaVersion := ScalaDotty, + crossScalaVersions := Seq(Scala213, Scala212), ThisBuild / scalaVersion := Scala213, scalacOptions := stdOptions ++ extraOptions(scalaVersion.value, optimize = !isSnapshot.value), libraryDependencies ++= {