Permalink
Browse files

Add Data.aggregate(data: Data): Data function

  • Loading branch information...
1 parent 33d99a9 commit dbee126efa549f33d7b968bc1999339fb93fed35 @ornicar committed Apr 26, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/main/scala/jdubext/Sql.scala
@@ -50,6 +50,12 @@ object SQL {
vals ::: valueSeq
)
+ def aggregate(data: Data) = Data(
+ nameSeq ::: data.nameSeq,
+ typeSeq ::: data.typeSeq,
+ valueSeq ::: data.valueSeq
+ )
+
def names = nameSeq mkString ", "
def types = typeSeq mkString ", "
@@ -69,6 +75,7 @@ object SQL {
}
def +(other: Data): Multi = Multi(this, other)
+ def +(other: Multi): Multi = other + this
}
case class Multi(datas: NonEmptyList[Data]) {

0 comments on commit dbee126

Please sign in to comment.