From fad3c2b41ff0a2ac6ace49e34ff06abe028ba21e Mon Sep 17 00:00:00 2001 From: Minglei Tu Date: Wed, 25 Jan 2017 13:49:41 +0800 Subject: [PATCH] enhance codegen example according to #325 --- examples/codegen-customization/build.sbt | 8 ++++---- .../codegen-customization/src/main/scala/Example.scala | 2 ++ examples/codegen-customization/src/sql/create-tables.sql | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/codegen-customization/build.sbt b/examples/codegen-customization/build.sbt index f613eea0..77f63f02 100644 --- a/examples/codegen-customization/build.sbt +++ b/examples/codegen-customization/build.sbt @@ -19,10 +19,10 @@ lazy val sharedSettings = Seq( libraryDependencies ++= List( "com.typesafe.slick" %% "slick" % "3.1.1", "org.postgresql" % "postgresql" % "9.4-1201-jdbc41", - "com.github.tminglei" %% "slick-pg" % "0.14.1", - "com.github.tminglei" %% "slick-pg_play-json" % "0.14.1", - "com.github.tminglei" %% "slick-pg_joda-time" % "0.14.1", - "com.github.tminglei" %% "slick-pg_jts" % "0.14.1", + "com.github.tminglei" %% "slick-pg" % "0.14.5", + "com.github.tminglei" %% "slick-pg_play-json" % "0.14.5", + "com.github.tminglei" %% "slick-pg_joda-time" % "0.14.5", + "com.github.tminglei" %% "slick-pg_jts" % "0.14.5", "joda-time" % "joda-time" % "2.4", "org.joda" % "joda-convert" % "1.7", "com.vividsolutions" % "jts" % "1.13", diff --git a/examples/codegen-customization/src/main/scala/Example.scala b/examples/codegen-customization/src/main/scala/Example.scala index 8e8a783c..7ae1a234 100644 --- a/examples/codegen-customization/src/main/scala/Example.scala +++ b/examples/codegen-customization/src/main/scala/Example.scala @@ -14,6 +14,8 @@ object Example extends App { val q = Supplier.join(Coffee).on(_.id === _.supId) .map{ case (s,c) => (s.name, c.name) } + println(">>> running Example ...") + Await.ready( db.run { q.result.map( diff --git a/examples/codegen-customization/src/sql/create-tables.sql b/examples/codegen-customization/src/sql/create-tables.sql index e690fb21..fd963bd4 100644 --- a/examples/codegen-customization/src/sql/create-tables.sql +++ b/examples/codegen-customization/src/sql/create-tables.sql @@ -14,6 +14,7 @@ create table COFFEE PRICE numeric(10,2) NOT NULL, SALES integer NOT NULL, TOTAL integer NOT NULL, + arrofbyteproblem bytea not null, PRIMARY KEY (NAME), FOREIGN KEY (SUP_ID) REFERENCES SUPPLIER (ID));