Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return type for generated kleisliinterpreter #1929

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,6 @@ lazy val free = project
classOf[java.sql.ResultSet]
)
},
freeGen2KleisliInterpreterImportExcludes := Set(
classOf[java.io.OutputStream],
classOf[java.io.Writer],
classOf[java.sql.DriverPropertyInfo],
classOf[java.sql.ParameterMetaData],
classOf[java.sql.ResultSetMetaData],
classOf[java.sql.RowIdLifetime],
classOf[java.sql.SQLWarning],
classOf[java.util.logging.Logger]
)
)


Expand Down Expand Up @@ -284,7 +274,6 @@ lazy val postgres = project
freeGen2Dir := (Compile / scalaSource).value / "doobie" / "postgres" / "free",
freeGen2Package := "doobie.postgres.free",
freeGen2Classes := {
import java.sql._
List[Class[_]](
classOf[org.postgresql.copy.CopyIn],
classOf[org.postgresql.copy.CopyManager],
Expand All @@ -299,15 +288,6 @@ lazy val postgres = project
classOf[org.postgresql.copy.CopyIn] -> "PGCopyIn",
classOf[org.postgresql.copy.CopyManager] -> "PGCopyManager",
classOf[org.postgresql.copy.CopyOut] -> "PGCopyOut",
classOf[org.postgresql.fastpath.Fastpath] -> "PGFastpath"
): @nowarn("msg=.*deprecated.*"),
freeGen2KleisliInterpreterImportExcludes := Set(
classOf[java.sql.Array],
classOf[java.util.Map[_, _]],
classOf[org.postgresql.PGNotification],
classOf[org.postgresql.copy.CopyDual],
classOf[org.postgresql.jdbc.PreferQueryMode],
classOf[org.postgresql.replication.PGReplicationConnection],
),
initialCommands := """
import cats._, cats.data._, cats.implicits._, cats.effect._
Expand Down
12 changes: 6 additions & 6 deletions modules/free/src/main/scala/doobie/free/callablestatement.scala
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ object callablestatement { module =>
def getNString(a: String): F[String]
def getObject(a: Int): F[AnyRef]
def getObject[T](a: Int, b: Class[T]): F[T]
def getObject(a: Int, b: Map[String, Class[_]]): F[AnyRef]
def getObject(a: Int, b: java.util.Map[String, Class[_]]): F[AnyRef]
def getObject(a: String): F[AnyRef]
def getObject[T](a: String, b: Class[T]): F[T]
def getObject(a: String, b: Map[String, Class[_]]): F[AnyRef]
def getObject(a: String, b: java.util.Map[String, Class[_]]): F[AnyRef]
def getParameterMetaData: F[ParameterMetaData]
def getQueryTimeout: F[Int]
def getRef(a: Int): F[Ref]
Expand Down Expand Up @@ -597,7 +597,7 @@ object callablestatement { module =>
final case class GetObject1[T](a: Int, b: Class[T]) extends CallableStatementOp[T] {
def visit[F[_]](v: Visitor[F]) = v.getObject(a, b)
}
final case class GetObject2(a: Int, b: Map[String, Class[_]]) extends CallableStatementOp[AnyRef] {
final case class GetObject2(a: Int, b: java.util.Map[String, Class[_]]) extends CallableStatementOp[AnyRef] {
def visit[F[_]](v: Visitor[F]) = v.getObject(a, b)
}
final case class GetObject3(a: String) extends CallableStatementOp[AnyRef] {
Expand All @@ -606,7 +606,7 @@ object callablestatement { module =>
final case class GetObject4[T](a: String, b: Class[T]) extends CallableStatementOp[T] {
def visit[F[_]](v: Visitor[F]) = v.getObject(a, b)
}
final case class GetObject5(a: String, b: Map[String, Class[_]]) extends CallableStatementOp[AnyRef] {
final case class GetObject5(a: String, b: java.util.Map[String, Class[_]]) extends CallableStatementOp[AnyRef] {
def visit[F[_]](v: Visitor[F]) = v.getObject(a, b)
}
case object GetParameterMetaData extends CallableStatementOp[ParameterMetaData] {
Expand Down Expand Up @@ -1169,10 +1169,10 @@ object callablestatement { module =>
def getNString(a: String): CallableStatementIO[String] = FF.liftF(GetNString1(a))
def getObject(a: Int): CallableStatementIO[AnyRef] = FF.liftF(GetObject(a))
def getObject[T](a: Int, b: Class[T]): CallableStatementIO[T] = FF.liftF(GetObject1(a, b))
def getObject(a: Int, b: Map[String, Class[_]]): CallableStatementIO[AnyRef] = FF.liftF(GetObject2(a, b))
def getObject(a: Int, b: java.util.Map[String, Class[_]]): CallableStatementIO[AnyRef] = FF.liftF(GetObject2(a, b))
def getObject(a: String): CallableStatementIO[AnyRef] = FF.liftF(GetObject3(a))
def getObject[T](a: String, b: Class[T]): CallableStatementIO[T] = FF.liftF(GetObject4(a, b))
def getObject(a: String, b: Map[String, Class[_]]): CallableStatementIO[AnyRef] = FF.liftF(GetObject5(a, b))
def getObject(a: String, b: java.util.Map[String, Class[_]]): CallableStatementIO[AnyRef] = FF.liftF(GetObject5(a, b))
val getParameterMetaData: CallableStatementIO[ParameterMetaData] = FF.liftF(GetParameterMetaData)
val getQueryTimeout: CallableStatementIO[Int] = FF.liftF(GetQueryTimeout)
def getRef(a: Int): CallableStatementIO[Ref] = FF.liftF(GetRef(a))
Expand Down
12 changes: 6 additions & 6 deletions modules/free/src/main/scala/doobie/free/connection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object connection { module =>
def getNetworkTimeout: F[Int]
def getSchema: F[String]
def getTransactionIsolation: F[Int]
def getTypeMap: F[Map[String, Class[_]]]
def getTypeMap: F[java.util.Map[String, Class[_]]]
def getWarnings: F[SQLWarning]
def isClosed: F[Boolean]
def isReadOnly: F[Boolean]
Expand Down Expand Up @@ -134,7 +134,7 @@ object connection { module =>
def setShardingKeyIfValid(a: ShardingKey, b: Int): F[Boolean]
def setShardingKeyIfValid(a: ShardingKey, b: ShardingKey, c: Int): F[Boolean]
def setTransactionIsolation(a: Int): F[Unit]
def setTypeMap(a: Map[String, Class[_]]): F[Unit]
def setTypeMap(a: java.util.Map[String, Class[_]]): F[Unit]
def unwrap[T](a: Class[T]): F[T]

}
Expand Down Expand Up @@ -259,7 +259,7 @@ object connection { module =>
case object GetTransactionIsolation extends ConnectionOp[Int] {
def visit[F[_]](v: Visitor[F]) = v.getTransactionIsolation
}
case object GetTypeMap extends ConnectionOp[Map[String, Class[_]]] {
case object GetTypeMap extends ConnectionOp[java.util.Map[String, Class[_]]] {
def visit[F[_]](v: Visitor[F]) = v.getTypeMap
}
case object GetWarnings extends ConnectionOp[SQLWarning] {
Expand Down Expand Up @@ -361,7 +361,7 @@ object connection { module =>
final case class SetTransactionIsolation(a: Int) extends ConnectionOp[Unit] {
def visit[F[_]](v: Visitor[F]) = v.setTransactionIsolation(a)
}
final case class SetTypeMap(a: Map[String, Class[_]]) extends ConnectionOp[Unit] {
final case class SetTypeMap(a: java.util.Map[String, Class[_]]) extends ConnectionOp[Unit] {
def visit[F[_]](v: Visitor[F]) = v.setTypeMap(a)
}
final case class Unwrap[T](a: Class[T]) extends ConnectionOp[T] {
Expand Down Expand Up @@ -418,7 +418,7 @@ object connection { module =>
val getNetworkTimeout: ConnectionIO[Int] = FF.liftF(GetNetworkTimeout)
val getSchema: ConnectionIO[String] = FF.liftF(GetSchema)
val getTransactionIsolation: ConnectionIO[Int] = FF.liftF(GetTransactionIsolation)
val getTypeMap: ConnectionIO[Map[String, Class[_]]] = FF.liftF(GetTypeMap)
val getTypeMap: ConnectionIO[java.util.Map[String, Class[_]]] = FF.liftF(GetTypeMap)
val getWarnings: ConnectionIO[SQLWarning] = FF.liftF(GetWarnings)
val isClosed: ConnectionIO[Boolean] = FF.liftF(IsClosed)
val isReadOnly: ConnectionIO[Boolean] = FF.liftF(IsReadOnly)
Expand Down Expand Up @@ -452,7 +452,7 @@ object connection { module =>
def setShardingKeyIfValid(a: ShardingKey, b: Int): ConnectionIO[Boolean] = FF.liftF(SetShardingKeyIfValid(a, b))
def setShardingKeyIfValid(a: ShardingKey, b: ShardingKey, c: Int): ConnectionIO[Boolean] = FF.liftF(SetShardingKeyIfValid1(a, b, c))
def setTransactionIsolation(a: Int): ConnectionIO[Unit] = FF.liftF(SetTransactionIsolation(a))
def setTypeMap(a: Map[String, Class[_]]): ConnectionIO[Unit] = FF.liftF(SetTypeMap(a))
def setTypeMap(a: java.util.Map[String, Class[_]]): ConnectionIO[Unit] = FF.liftF(SetTypeMap(a))
def unwrap[T](a: Class[T]): ConnectionIO[T] = FF.liftF(Unwrap(a))

// Typeclass instances for ConnectionIO
Expand Down
Loading