Skip to content

Commit 3a79017

Browse files
Alberto Perez LopezAlberto Perez Lopez
Alberto Perez Lopez
authored and
Alberto Perez Lopez
committed
Bump scala3 and sqlite-jdbc
1 parent 00e3504 commit 3a79017

File tree

2 files changed

+101
-101
lines changed

2 files changed

+101
-101
lines changed

build.sbt

+93-93
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
1-
ThisBuild / organization := "com.albertprz"
2-
ThisBuild / version := "1.0.0"
3-
ThisBuild / Compile / compile / logLevel := Level.Warn
4-
Global / excludeLintKeys += logLevel
5-
Global / onChangedBuildSource := ReloadOnSourceChanges
6-
Test / parallelExecution := false
7-
8-
9-
val scala3Ver = "3.0.0"
10-
val scala2Ver = "2.13.8"
11-
12-
13-
lazy val commonSettings = Seq(
14-
15-
scalaVersion := scala3Ver,
16-
17-
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
18-
case Some((2, 13)) => Seq("-Ytasty-reader")
19-
case _ => Seq("-new-syntax", "-indent")
20-
}),
21-
22-
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
23-
case Some((2, 13)) => scalaReflect.map(_ % scalaVersion.value)
24-
case _ => Seq()
25-
})
26-
)
27-
28-
29-
lazy val coreSettings = Seq(
30-
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
31-
case Some((2, 13)) => cats ++ catsEffect ++ pureconfig
32-
case _ => cats ++ catsEffect ++ pureconfig.map(_.cross(CrossVersion.for3Use2_13))
33-
})
34-
)
35-
36-
37-
lazy val testSettings = inConfig(IntegrationTest)(Defaults.itSettings) ++
38-
Seq (
39-
IntegrationTest / scalaSource := baseDirectory.value / "src/it/scala",
40-
TaskKey[Unit]("test") := (IntegrationTest / test).dependsOn(Test / test).value,
41-
libraryDependencies ++= (scalaTest ++ sqlite).map(_ % "it,test")
42-
)
43-
44-
45-
46-
lazy val core = project
47-
.in(file("core"))
48-
.settings(
49-
name := "logograph-core",
50-
commonSettings,
51-
coreSettings
52-
)
53-
54-
lazy val macros = project
55-
.in(file("macros"))
56-
.settings(
57-
name := "logograph-macros",
58-
commonSettings,
59-
crossScalaVersions := Seq(scala3Ver, scala2Ver)
60-
)
61-
.dependsOn(core)
62-
63-
lazy val app = project
64-
.in(file("."))
65-
.configs(IntegrationTest)
66-
.settings(
67-
name := "logograph",
68-
commonSettings,
69-
testSettings,
70-
crossScalaVersions := Seq(scala3Ver, scala2Ver)
71-
)
72-
.dependsOn(core, macros)
73-
.aggregate(core, macros)
74-
75-
76-
77-
78-
/// Main Dependencies ///
79-
val scalaReflect = Seq("org.scala-lang" % "scala-reflect")
80-
81-
val cats = Seq("org.typelevel" %% "cats-core" % "2.6.1",
82-
"org.typelevel" %% "cats-kernel" % "2.6.1")
83-
84-
val catsEffect = Seq("org.typelevel" %% "cats-effect" % "3.1.1")
85-
86-
val pureconfig = Seq("com.github.pureconfig" %% "pureconfig" % "0.16.0")
87-
88-
89-
/// Test Dependencies ///
90-
val scalaTest = Seq("org.scalatest" %% "scalatest" % "3.2.9",
91-
"org.scalactic" %% "scalactic" % "3.2.9")
92-
93-
val sqlite = Seq("org.xerial" % "sqlite-jdbc" % "3.14.2")
1+
ThisBuild / organization := "com.albertprz"
2+
ThisBuild / version := "1.0.0"
3+
ThisBuild / Compile / compile / logLevel := Level.Warn
4+
Global / excludeLintKeys += logLevel
5+
Global / onChangedBuildSource := ReloadOnSourceChanges
6+
Test / parallelExecution := false
7+
8+
9+
val scala3Ver = "3.3.4"
10+
val scala2Ver = "2.13.8"
11+
12+
13+
lazy val commonSettings = Seq(
14+
15+
scalaVersion := scala3Ver,
16+
17+
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
18+
case Some((2, 13)) => Seq("-Ytasty-reader")
19+
case _ => Seq("-new-syntax", "-indent")
20+
}),
21+
22+
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
23+
case Some((2, 13)) => scalaReflect.map(_ % scalaVersion.value)
24+
case _ => Seq()
25+
})
26+
)
27+
28+
29+
lazy val coreSettings = Seq(
30+
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
31+
case Some((2, 13)) => cats ++ catsEffect ++ pureconfig
32+
case _ => cats ++ catsEffect ++ pureconfig.map(_.cross(CrossVersion.for3Use2_13))
33+
})
34+
)
35+
36+
37+
lazy val testSettings = inConfig(IntegrationTest)(Defaults.itSettings) ++
38+
Seq (
39+
IntegrationTest / scalaSource := baseDirectory.value / "src/it/scala",
40+
TaskKey[Unit]("test") := (IntegrationTest / test).dependsOn(Test / test).value,
41+
libraryDependencies ++= (scalaTest ++ sqlite).map(_ % "it,test")
42+
)
43+
44+
45+
46+
lazy val core = project
47+
.in(file("core"))
48+
.settings(
49+
name := "logograph-core",
50+
commonSettings,
51+
coreSettings
52+
)
53+
54+
lazy val macros = project
55+
.in(file("macros"))
56+
.settings(
57+
name := "logograph-macros",
58+
commonSettings,
59+
crossScalaVersions := Seq(scala3Ver, scala2Ver)
60+
)
61+
.dependsOn(core)
62+
63+
lazy val app = project
64+
.in(file("."))
65+
.configs(IntegrationTest)
66+
.settings(
67+
name := "logograph",
68+
commonSettings,
69+
testSettings,
70+
crossScalaVersions := Seq(scala3Ver, scala2Ver)
71+
)
72+
.dependsOn(core, macros)
73+
.aggregate(core, macros)
74+
75+
76+
77+
78+
/// Main Dependencies ///
79+
val scalaReflect = Seq("org.scala-lang" % "scala-reflect")
80+
81+
val cats = Seq("org.typelevel" %% "cats-core" % "2.6.1",
82+
"org.typelevel" %% "cats-kernel" % "2.6.1")
83+
84+
val catsEffect = Seq("org.typelevel" %% "cats-effect" % "3.1.1")
85+
86+
val pureconfig = Seq("com.github.pureconfig" %% "pureconfig" % "0.16.0")
87+
88+
89+
/// Test Dependencies ///
90+
val scalaTest = Seq("org.scalatest" %% "scalatest" % "3.2.9",
91+
"org.scalactic" %% "scalactic" % "3.2.9")
92+
93+
val sqlite = Seq("org.xerial" % "sqlite-jdbc" % "3.47.1.0")

core/src/main/scala/SQLExpression.scala

+8-8
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ case class Table(tableName: String) (using cfg: LogographConfig)
8080
case class Column(columnName: String, tableName: String) (using cfg: LogographConfig)
8181
extends SQLClause:
8282

83-
lazy val sql = if columnName != "*" then columnName.convert(cfg.columnConverter
84-
.map(_.getOrElse(tableName, Map.empty)))
85-
.convertCase(cfg.columnCaseConverter)
86-
.wrapBrackets()
87-
else columnName
83+
lazy val sql = if columnName != "*"
84+
then columnName
85+
.convert(cfg.columnConverter.map(_.getOrElse(tableName, Map.empty)))
86+
.convertCase(cfg.columnCaseConverter)
87+
.wrapBrackets()
88+
else columnName
8889

8990
case class Operator(operatorName: String) (using cfg: LogographConfig)
9091
extends SQLClause:
@@ -99,14 +100,13 @@ private object SQLExpression:
99100
expr match
100101
case fld: Field => if isAgg then List(fld) else List.empty
101102
case op: Operation => op.operands
102-
.flatMap(findAggFields(_, isAgg || SQLOperations.aggOps.contains(op.operator)))
103+
.flatMap(findAggFields(_, isAgg || SQLOperations.aggOps.contains(op.operator)))
103104
case _ => List.empty
104105

105106
def findFields (expr: SQLExpression): List[Field] =
106107
expr match
107108
case fld: Field => List(fld)
108-
case op: Operation => op.operands
109-
.flatMap(findFields)
109+
case op: Operation => op.operands.flatMap(findFields)
110110
case _ => List.empty
111111

112112
private object Predicate:

0 commit comments

Comments
 (0)