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

Basic support for Slick 3.5.x #378

Merged
merged 6 commits into from
Jul 20, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.11, 3.3.0]
scala: [2.13.11, 3.3.3]
java: [temurin@17]
runs-on: ${{ matrix.os }}
steps:
Expand Down
15 changes: 7 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ lazy val baseSettings = Seq(
organizationName := "Iterators",
organizationHomepage := Some(url("https://iterato.rs")),
homepage := Some(url("https://github.com/theiterators/kebs")),
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-encoding", "utf8", "Xsource:3") ++ (if (scalaVersion.value.startsWith("3")) Seq("-Xmax-inlines", "64") else Seq.empty),
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-encoding", "utf8") ++ (if (scalaVersion.value.startsWith("3")) Seq("-Xmax-inlines", "64", "-Yretain-trees") else Seq.empty),
)

lazy val commonMacroSettings = baseSettings ++ Seq(
Expand Down Expand Up @@ -99,10 +99,10 @@ def paradiseFlag(scalaVersion: String): Seq[String] =

val scalaTest = Def.setting("org.scalatest" %%% "scalatest" % "3.2.17")
val scalaCheck = Def.setting("org.scalacheck" %%% "scalacheck" % "1.17.0")
val slick = "com.typesafe.slick" %% "slick" % "3.4.1"
val slick = "com.typesafe.slick" %% "slick" % "3.5.1"
val optionalSlick = optional(slick)
val playJson = "org.playframework" %% "play-json" % "3.0.4"
val slickPg = "com.github.tminglei" %% "slick-pg" % "0.21.1"
val slickPg = "com.github.tminglei" %% "slick-pg" % "0.22.2"
val doobie = "org.tpolecat" %% "doobie-core" % "1.0.0-RC4"
val doobiePg = "org.tpolecat" %% "doobie-postgres" % "1.0.0-RC4"
val sprayJson = "io.spray" %% "spray-json" % "1.3.6"
Expand Down Expand Up @@ -171,8 +171,8 @@ lazy val commonSettings = baseSettings ++ Seq(
)

lazy val slickSettings = commonSettings ++ Seq(
libraryDependencies += slick.cross(CrossVersion.for3Use2_13),
libraryDependencies += (slickPg % "test").cross(CrossVersion.for3Use2_13),
libraryDependencies += slick,
libraryDependencies += (slickPg % "test"),
libraryDependencies += (enumeratum % "test")
)

Expand Down Expand Up @@ -263,14 +263,14 @@ lazy val scalacheckSettings = commonSettings ++ Seq(
else Nil))

lazy val taggedSettings = commonSettings ++ Seq(
libraryDependencies += optionalSlick.cross(CrossVersion.for3Use2_13),
libraryDependencies += optionalSlick,
libraryDependencies += optional(circe)
)

lazy val opaqueSettings = commonSettings

lazy val examplesSettings = commonSettings ++ Seq(
libraryDependencies += slickPg.cross(CrossVersion.for3Use2_13),
libraryDependencies += slickPg,
libraryDependencies += circeParser,
libraryDependencies ++= enumeratumInExamples,
libraryDependencies ++= pekkoHttpInExamples,
Expand Down Expand Up @@ -301,7 +301,6 @@ lazy val slickSupport = project
.dependsOn(core.jvm, enumeratumSupport, instances % "test -> test")
.settings(slickSettings*)
.settings(publishSettings*)
.settings(disableScala(List("3")))
.settings(
name := "slick",
description := "Library to eliminate the boilerplate code that comes with the use of Slick",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import scala.deriving.Mirror
final class ValueClassLike[VC, F1](val apply: F1 => VC, val unapply: VC => F1)

trait CaseClass1ToValueClass {
inline given[T <: Product, F1](using m: Mirror.ProductOf[T], teq: m.MirroredElemTypes =:= F1 *: EmptyTuple.type): ValueClassLike[T, F1] = {
implicit def repFromCaseClass[T <: Product, F1](using m: Mirror.ProductOf[T], teq: m.MirroredElemTypes =:= F1 *: EmptyTuple.type): ValueClassLike[T, F1] = {
new ValueClassLike[T, F1](f1 => m.fromProduct(Tuple1(f1)), _.productElement(0).asInstanceOf[F1])
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ object EnumValueColumnType {

object AfterKebsTraitStyle {

import pl.iterators.kebs.slick.Kebs
import pl.iterators.kebs.slick.KebsSlickSupport

object MyPostgresProfile extends ExPostgresProfile {
override val api: APIWithKebsAndEnums = new APIWithKebsAndEnums {}
trait APIWithKebsAndEnums extends super.API with Kebs with KebsEnums.Lowercase
trait APIWithKebsAndEnums extends super.API with KebsSlickSupport with KebsEnums.Lowercase
}

import MyPostgresProfile.api._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ object HStoreColumnType {

object AfterKebs {
import pl.iterators.kebs.circe.instances.time.YearMonthString
import pl.iterators.kebs.slick.Kebs
import pl.iterators.kebs.slick.KebsSlickSupport

object MyPostgresProfile extends ExPostgresProfile with PgHStoreSupport {
override val api: APIWithHstore = new APIWithHstore {}
trait APIWithHstore extends super.API with HStoreImplicits with Kebs with YearMonthString
trait APIWithHstore extends super.API with HStoreImplicits with KebsSlickSupport with YearMonthString
}

import MyPostgresProfile.api._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ object HStoreExtensionMethods {

object AfterKebs {
import pl.iterators.kebs.circe.instances.time.YearMonthString
import pl.iterators.kebs.slick.Kebs
import pl.iterators.kebs.slick.KebsSlickSupport

object MyPostgresProfile extends ExPostgresProfile with PgHStoreSupport with PgArraySupport {
override val api: APIWithHstore = new APIWithHstore {}
trait APIWithHstore extends super.API with HStoreImplicits with ArrayImplicits with Kebs with YearMonthString
trait APIWithHstore extends super.API with HStoreImplicits with ArrayImplicits with KebsSlickSupport with YearMonthString
}

import MyPostgresProfile.api._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ object ListValueCommonType {

object AfterKebsTraitStyle {

import pl.iterators.kebs.slick.Kebs
import pl.iterators.kebs.slick.KebsSlickSupport
object MyPostgresProfile extends ExPostgresProfile with PgArraySupport {
override val api: APIWithArraysAndKebs = new APIWithArraysAndKebs {}
trait APIWithArraysAndKebs extends super.API with ArrayImplicits with Kebs
trait APIWithArraysAndKebs extends super.API with ArrayImplicits with KebsSlickSupport
}

import MyPostgresProfile.api._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package pl.iterators.kebs.examples
import slick.jdbc.PostgresProfile.api._
import slick.lifted.ProvenShape
import pl.iterators.kebs.tagged._
import pl.iterators.kebs.tagged.slick.SlickSupport
import pl.iterators.kebs.tagged.slick.TaggedSlickSupport

object SlickTaggedExample extends SlickSupport {
object SlickTaggedExample extends TaggedSlickSupport {
trait UserIdTag
type UserId = Long @@ UserIdTag

Expand Down
174 changes: 0 additions & 174 deletions slick/src/main/scala/pl/iterators/kebs/slick/Kebs.scala

This file was deleted.

Loading
Loading