Skip to content

Commit a506048

Browse files
committed
Upgrade postgis to 2023.1.0 / postgres-jdbc to 42.7.1
1 parent 9fa2f52 commit a506048

File tree

8 files changed

+28
-12
lines changed

8 files changed

+28
-12
lines changed

build.sbt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ lazy val h2Version = "1.4.200"
1212
lazy val hikariVersion = "5.1.0" // N.B. Hikari v4 introduces a breaking change via slf4j v2
1313
lazy val kindProjectorVersion = "0.11.2"
1414
lazy val log4catsVersion = "2.6.0"
15-
lazy val postGisVersion = "2.5.1"
16-
lazy val postgresVersion = "42.7.0"
15+
lazy val postGisVersion = "2023.1.0"
16+
lazy val postgresVersion = "42.7.1"
1717
lazy val refinedVersion = "0.11.0"
1818
lazy val scalaCheckVersion = "1.15.4"
1919
lazy val scalatestVersion = "3.2.17"
@@ -88,6 +88,9 @@ lazy val compilerFlags = Seq(
8888
Test / scalacOptions --= Seq(
8989
"-Xfatal-warnings"
9090
),
91+
// scalacOptions ++= Seq(
92+
// "-Xsource:3"
93+
// )
9194
)
9295

9396
lazy val buildSettings = Seq(
@@ -313,7 +316,7 @@ lazy val postgres = project
313316
val xa = Transactor.fromDriverManager[IO](driver = "org.postgresql.Driver", url = "jdbc:postgresql:world", user = "postgres", pass = "password", logHandler = None)
314317
val yolo = xa.yolo
315318
import yolo._
316-
import org.postgis._
319+
import net.postgis._
317320
import org.postgresql.util._
318321
import org.postgresql.geometric._
319322
""",

modules/docs/src/main/mdoc/docs/15-Extensions-PostgreSQL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ It is expected that these will be mapped to application-specific types via `xmap
188188

189189
### PostGIS Types
190190

191-
**doobie** provides mappings for the top-level PostGIS geometric types provided by the `org.postgis` driver extension.
191+
**doobie** provides mappings for the top-level PostGIS geometric types provided by the `net.postgis` driver extension.
192192

193193
Mappings for postgis are provided in the `pgistypes` module. Doobie expects postgis dependency to be provided, so if you use this module you should add postgis as a dependency.
194194

modules/postgres/src/main/scala/doobie/postgres/free/kleisliinterpreter.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ class KleisliInterpreter[M[_]](logHandler: LogHandler[M])(implicit val asyncM: W
248248
override def close: Kleisli[M, LargeObject, Unit] = primitive(_.close)
249249
override def copy: Kleisli[M, LargeObject, LargeObject] = primitive(_.copy)
250250
override def getInputStream: Kleisli[M, LargeObject, InputStream] = primitive(_.getInputStream)
251+
override def getInputStream(a: Int, b: Long) = primitive(_.getInputStream(a, b))
251252
override def getInputStream(a: Long) = primitive(_.getInputStream(a))
252253
override def getLongOID: Kleisli[M, LargeObject, Long] = primitive(_.getLongOID)
253254
override def getOutputStream: Kleisli[M, LargeObject, OutputStream] = primitive(_.getOutputStream)
@@ -264,6 +265,7 @@ class KleisliInterpreter[M[_]](logHandler: LogHandler[M])(implicit val asyncM: W
264265
override def truncate64(a: Long) = primitive(_.truncate64(a))
265266
override def write(a: Array[Byte]) = primitive(_.write(a))
266267
override def write(a: Array[Byte], b: Int, c: Int) = primitive(_.write(a, b, c))
268+
override def write(a: ByteStreamWriter) = primitive(_.write(a))
267269

268270
}
269271

modules/postgres/src/main/scala/doobie/postgres/free/largeobject.scala

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import scala.concurrent.duration.FiniteDuration
1515
import java.io.InputStream
1616
import java.io.OutputStream
1717
import org.postgresql.largeobject.LargeObject
18+
import org.postgresql.util.ByteStreamWriter
1819

1920
// This file is Auto-generated using FreeGen2.scala
2021
object largeobject { module =>
@@ -63,6 +64,7 @@ object largeobject { module =>
6364
def close: F[Unit]
6465
def copy: F[LargeObject]
6566
def getInputStream: F[InputStream]
67+
def getInputStream(a: Int, b: Long): F[InputStream]
6668
def getInputStream(a: Long): F[InputStream]
6769
def getLongOID: F[Long]
6870
def getOutputStream: F[OutputStream]
@@ -79,6 +81,7 @@ object largeobject { module =>
7981
def truncate64(a: Long): F[Unit]
8082
def write(a: Array[Byte]): F[Unit]
8183
def write(a: Array[Byte], b: Int, c: Int): F[Unit]
84+
def write(a: ByteStreamWriter): F[Unit]
8285

8386
}
8487

@@ -139,7 +142,10 @@ object largeobject { module =>
139142
case object GetInputStream extends LargeObjectOp[InputStream] {
140143
def visit[F[_]](v: Visitor[F]) = v.getInputStream
141144
}
142-
final case class GetInputStream1(a: Long) extends LargeObjectOp[InputStream] {
145+
final case class GetInputStream1(a: Int, b: Long) extends LargeObjectOp[InputStream] {
146+
def visit[F[_]](v: Visitor[F]) = v.getInputStream(a, b)
147+
}
148+
final case class GetInputStream2(a: Long) extends LargeObjectOp[InputStream] {
143149
def visit[F[_]](v: Visitor[F]) = v.getInputStream(a)
144150
}
145151
case object GetLongOID extends LargeObjectOp[Long] {
@@ -187,6 +193,9 @@ object largeobject { module =>
187193
final case class Write1(a: Array[Byte], b: Int, c: Int) extends LargeObjectOp[Unit] {
188194
def visit[F[_]](v: Visitor[F]) = v.write(a, b, c)
189195
}
196+
final case class Write2(a: ByteStreamWriter) extends LargeObjectOp[Unit] {
197+
def visit[F[_]](v: Visitor[F]) = v.write(a)
198+
}
190199

191200
}
192201
import LargeObjectOp._
@@ -217,7 +226,8 @@ object largeobject { module =>
217226
val close: LargeObjectIO[Unit] = FF.liftF(Close)
218227
val copy: LargeObjectIO[LargeObject] = FF.liftF(Copy)
219228
val getInputStream: LargeObjectIO[InputStream] = FF.liftF(GetInputStream)
220-
def getInputStream(a: Long): LargeObjectIO[InputStream] = FF.liftF(GetInputStream1(a))
229+
def getInputStream(a: Int, b: Long): LargeObjectIO[InputStream] = FF.liftF(GetInputStream1(a, b))
230+
def getInputStream(a: Long): LargeObjectIO[InputStream] = FF.liftF(GetInputStream2(a))
221231
val getLongOID: LargeObjectIO[Long] = FF.liftF(GetLongOID)
222232
val getOutputStream: LargeObjectIO[OutputStream] = FF.liftF(GetOutputStream)
223233
def read(a: Array[Byte], b: Int, c: Int): LargeObjectIO[Int] = FF.liftF(Read(a, b, c))
@@ -233,6 +243,7 @@ object largeobject { module =>
233243
def truncate64(a: Long): LargeObjectIO[Unit] = FF.liftF(Truncate64(a))
234244
def write(a: Array[Byte]): LargeObjectIO[Unit] = FF.liftF(Write(a))
235245
def write(a: Array[Byte], b: Int, c: Int): LargeObjectIO[Unit] = FF.liftF(Write1(a, b, c))
246+
def write(a: ByteStreamWriter): LargeObjectIO[Unit] = FF.liftF(Write2(a))
236247

237248
// Typeclass instances for LargeObjectIO
238249
implicit val WeakAsyncLargeObjectIO: WeakAsync[LargeObjectIO] =

modules/postgres/src/main/scala/doobie/postgres/pgisgeographyinstances.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package doobie.postgres
66

77
import doobie._
88
import doobie.util.invariant._
9-
10-
import org.postgis._
9+
import net.postgis.jdbc.PGgeography
10+
import net.postgis.jdbc.geometry._
1111

1212
import scala.reflect.ClassTag
1313
import org.tpolecat.typename._

modules/postgres/src/main/scala/doobie/postgres/pgisinstances.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package doobie.postgres
66

77
import doobie._
88
import doobie.util.invariant._
9-
10-
import org.postgis._
9+
import net.postgis.jdbc.{PGbox2d, PGbox3d, PGgeometry}
10+
import net.postgis.jdbc.geometry._
1111

1212
import scala.reflect.ClassTag
1313
import org.tpolecat.typename._

modules/postgres/src/test/scala/doobie/postgres/TypesSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import doobie.postgres.pgisimplicits._
1717
import doobie.postgres.util.arbitraries.SQLArbitraries._
1818
import doobie.postgres.util.arbitraries.TimeArbitraries._
1919
import doobie.util.arbitraries.StringArbitraries._
20-
import org.postgis._
20+
import net.postgis.jdbc.geometry._
2121
import org.postgresql.geometric._
2222
import org.postgresql.util._
2323
import org.scalacheck.Arbitrary

project/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Required for the freegen definition for postgres in ../build.sbt
2-
val postgresVersion = "42.7.0"
2+
val postgresVersion = "42.7.1"
33
libraryDependencies += "org.postgresql" % "postgresql" % postgresVersion

0 commit comments

Comments
 (0)