From f6d2b8697d1e0d18ab94c366b0ee4006b8e3c914 Mon Sep 17 00:00:00 2001 From: Naftoli Gugenheim <98384+nafg@users.noreply.github.com> Date: Mon, 10 Jul 2023 02:41:39 -0400 Subject: [PATCH] Slick 3.5.0-M4 --- build.sbt | 2 +- .../github/tminglei/slickpg/agg/PgAggFuncCore.scala | 1 + .../slickpg/lobj/LargeObjectStreamingDBIOAction.scala | 11 +++++++++-- .../tminglei/slickpg/window/PgWindowFuncCore.scala | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 7df064d2..dd2e0af7 100644 --- a/build.sbt +++ b/build.sbt @@ -64,7 +64,7 @@ def mainDependencies(scalaVersion: String) = { Seq ( "org.scala-lang.modules" %% "scala-parser-combinators" % "2.3.0", "org.scala-lang" % "scala-reflect" % scalaVersion, - "com.typesafe.slick" %% "slick" % "3.5.0-M3", + "com.typesafe.slick" %% "slick" % "3.5.0-M4", "org.postgresql" % "postgresql" % "42.6.0", "org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0", "org.slf4j" % "slf4j-simple" % "2.0.7" % "provided", diff --git a/core/src/main/scala/com/github/tminglei/slickpg/agg/PgAggFuncCore.scala b/core/src/main/scala/com/github/tminglei/slickpg/agg/PgAggFuncCore.scala index 12866ddb..527a3cf9 100644 --- a/core/src/main/scala/com/github/tminglei/slickpg/agg/PgAggFuncCore.scala +++ b/core/src/main/scala/com/github/tminglei/slickpg/agg/PgAggFuncCore.scala @@ -17,6 +17,7 @@ final case class AggFuncExpr( forOrderedSet: Boolean = false )(val buildType: Type) extends SimplyTypedNode { type Self = AggFuncExpr + override def self: AggFuncExpr = this override def children: ConstArray[Node] = params ++ orderBy.map(_._1) ++ ConstArray.from(filter) override protected[this] def rebuild(ch: ConstArray[Node]): Self = { val newAggParams = ch.slice(0, params.length) diff --git a/core/src/main/scala/com/github/tminglei/slickpg/lobj/LargeObjectStreamingDBIOAction.scala b/core/src/main/scala/com/github/tminglei/slickpg/lobj/LargeObjectStreamingDBIOAction.scala index 5ab9d4ab..26d6e9dd 100644 --- a/core/src/main/scala/com/github/tminglei/slickpg/lobj/LargeObjectStreamingDBIOAction.scala +++ b/core/src/main/scala/com/github/tminglei/slickpg/lobj/LargeObjectStreamingDBIOAction.scala @@ -14,7 +14,15 @@ import slick.util.DumpInfo * @param largeObjectId The oid of the LargeObject to stream. * @param bufferSize The chunk size in bytes. Default to 8KB. */ -case class LargeObjectStreamingDBIOAction(largeObjectId: Long, bufferSize: Int = 1024 * 8) extends SynchronousDatabaseAction[Array[Byte], Streaming[Array[Byte]], JdbcBackend, Effect.All] { +case class LargeObjectStreamingDBIOAction(largeObjectId: Long, bufferSize: Int = 1024 * 8) + extends SynchronousDatabaseAction[ + Array[Byte], + Streaming[Array[Byte]], + JdbcBackend#Context, + JdbcBackend#StreamingContext, + Effect.All + ] { + //our StreamState is the InputStream on the LargeObject instance and the number of bytes read in on the last run. type StreamState = (InputStream, Int) @@ -111,4 +119,3 @@ case class LargeObjectStreamingDBIOAction(largeObjectId: Long, bufferSize: Int = } } } - diff --git a/core/src/main/scala/com/github/tminglei/slickpg/window/PgWindowFuncCore.scala b/core/src/main/scala/com/github/tminglei/slickpg/window/PgWindowFuncCore.scala index 3beb8c2f..5c0c5d46 100644 --- a/core/src/main/scala/com/github/tminglei/slickpg/window/PgWindowFuncCore.scala +++ b/core/src/main/scala/com/github/tminglei/slickpg/window/PgWindowFuncCore.scala @@ -15,6 +15,7 @@ final case class WindowFuncExpr( frameDef: Option[(String, String, Option[String])] = None ) extends SimplyTypedNode { type Self = WindowFuncExpr + override def self: WindowFuncExpr = this protected def buildType = aggFuncExpr.nodeType override def children: ConstArray[Node] = aggFuncExpr +: (partitionBy ++ orderBy.map(_._1)) override protected[this] def rebuild(ch: ConstArray[Node]): Self = {