Skip to content

Commit

Permalink
ZIO Jdbc Module
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed Mar 11, 2021
1 parent 7895c5d commit 45a1782
Show file tree
Hide file tree
Showing 76 changed files with 3,141 additions and 1,911 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ nohup.out
project/.bloop/
/io/
/.metadata/
.bsp/
.jvmopts
23 changes: 16 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ If you have non-local docker change it depending on your settings.

Finally, you can use `sbt` locally.

### All In One ###

To restart the database services, rebuild them, and start with locally explosed ports run:

docker-compose down && docker-compose build && docker-compose run --rm --service-ports setup

Note: Make sure you have exposed all the ports as mentioned above.

## Debugging using Intellij

[Intellij](https://www.jetbrains.com/idea/) has a comprehensive debugger that also works with macros which is very
Expand Down Expand Up @@ -265,13 +273,14 @@ Set a breakpoint anywhere in the Quill codebase and run this configuration from
Some additional arguments you can add to your compiler's VM args provide insight into Quill's compilation:

```
-DdebugMacro=true // Enables libraries needed to debug via an Intellij Application session (default=false)
-Dquill.macro.log.pretty=true // Pretty print the SQL Queries that Quill produces (default=false)
-Dquill.macro.log=true // Enable/Disable priting of the SQL Queries Quill generates during compile-time (default=true)
-Dquill.trace.enabled=true // Global switch that Enables/Disables printing of Quill ASTs during compilation (default=false)
-Dquill.trace.color=true // Print Quill ASTs in color (default=false)
-Dquill.trace.opinion=false // Print the parts of Quill ASTs not directly used in the main transformation phases (called Opinions). (default=false)
-Dquill.trace.ast.simple=true // Print the raw Quill ASTs elements or a more compact view of the AST code (think `show` vs `showRaw` in Scala macros). (default=true)
-DdebugMacro=true // Enables libraries needed to debug via an Intellij Application session (default=false)
-DexcludeTests=false // Excludes testing code from being build. Useful during development times that require rapid iteration
-Dquill.macro.log.pretty=true // Pretty print the SQL Queries that Quill produces (default=false)
-Dquill.macro.log=true // Enable/Disable priting of the SQL Queries Quill generates during compile-time (default=true)
-Dquill.trace.enabled=true // Global switch that Enables/Disables printing of Quill ASTs during compilation (default=false)
-Dquill.trace.color=true // Print Quill ASTs in color (default=false)
-Dquill.trace.opinion=false // Print the parts of Quill ASTs not directly used in the main transformation phases (called Opinions). (default=false)
-Dquill.trace.ast.simple=true // Print the raw Quill ASTs elements or a more compact view of the AST code (think `show` vs `showRaw` in Scala macros). (default=true)
-Dquill.trace.types=sql,standard,alias,norm // What parts of the Quill transformations to print during compilation?
```

Expand Down
51 changes: 45 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ lazy val jasyncModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](
lazy val asyncModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](
`quill-async`, `quill-async-mysql`, `quill-async-postgres`,
`quill-finagle-mysql`, `quill-finagle-postgres`,
`quill-ndbc`, `quill-ndbc-postgres`, `quill-ndbc-monix`
`quill-ndbc`, `quill-ndbc-postgres`, `quill-ndbc-monix`,
`quill-zio`, `quill-jdbc-zio`
) ++ jasyncModules

lazy val codegenModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](
Expand Down Expand Up @@ -88,6 +89,9 @@ val filteredModules = {
case Some("codegen") =>
println("Compiling Code Generator Modules")
codegenModules
case Some("nocodegen") =>
println("Compiling Code Generator Modules")
baseModules ++ jsModules ++ dbModules ++ asyncModules ++ bigdataModules
case Some("bigdata") =>
println("Compiling Big Data Modules")
bigdataModules
Expand All @@ -114,8 +118,8 @@ val filteredModules = {
lazy val `quill` = {
val quill =
(project in file("."))
.settings(commonSettings: _*)
.settings(`tut-settings`:_*)
.settings(commonSettings: _*)
.settings(`tut-settings`:_*)

// Do not do aggregate project builds when debugging since during that time
// typically only individual modules are being build/compiled. This is mostly for convenience with IntelliJ.
Expand Down Expand Up @@ -365,7 +369,6 @@ lazy val `quill-jdbc` =

lazy val `quill-monix` =
(project in file("quill-monix"))

.settings(commonSettings: _*)
.settings(mimaSettings: _*)
.settings(
Expand Down Expand Up @@ -398,6 +401,42 @@ lazy val `quill-jdbc-monix` =
.dependsOn(`quill-sql-jvm` % "compile->compile;test->test")
.dependsOn(`quill-jdbc` % "compile->compile;test->test")

lazy val `quill-zio` =
(project in file("quill-zio"))
.settings(commonSettings: _*)
.settings(mimaSettings: _*)
.settings(
fork in Test := true,
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % "1.0.5",
"dev.zio" %% "zio-streams" % "1.0.5"
)
)
.dependsOn(`quill-core-jvm` % "compile->compile;test->test")

lazy val `quill-jdbc-zio` =
(project in file("quill-jdbc-zio"))
.settings(commonSettings: _*)
.settings(mimaSettings: _*)
.settings(jdbcTestingSettings: _*)
.settings(
testGrouping in Test := {
(definedTests in Test).value map { test =>
if (test.name endsWith "IntegrationSpec")
Tests.Group(name = test.name, tests = Seq(test), runPolicy = Tests.SubProcess(
ForkOptions().withRunJVMOptions(Vector("-Xmx200m"))
))
else
Tests.Group(name = test.name, tests = Seq(test), runPolicy = Tests.SubProcess(ForkOptions()))
}
}
)
.dependsOn(`quill-zio` % "compile->compile;test->test")
.dependsOn(`quill-sql-jvm` % "compile->compile;test->test")
.dependsOn(`quill-jdbc` % "compile->compile;test->test")



lazy val `quill-ndbc-monix` =
(project in file("quill-ndbc-monix"))
.settings(commonSettings: _*)
Expand Down Expand Up @@ -822,7 +861,7 @@ lazy val basicSettings = Seq(
Seq("-Ypatmat-exhaust-depth", "40")
case Some((2, 11)) =>
Seq("-Xlint",
"-Xfatal-warnings",
//"-Xfatal-warnings",
"-Xfuture",
"-deprecation",
"-Yno-adapted-args",
Expand All @@ -831,7 +870,7 @@ lazy val basicSettings = Seq(
)
case Some((2, 12)) =>
Seq(
"-Xfatal-warnings",
//"-Xfatal-warnings",
"-Xlint:-unused,_",
"-Xfuture",
"-deprecation",
Expand Down
7 changes: 5 additions & 2 deletions build/Dockerfile-setup
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

ENV CASSANDRA_VERSION 3.11.9
ENV CASSANDRA_VERSION 3.11.10

RUN echo "Cassandra Version: $CASSANDRA_VERSION"
RUN echo "Getting http://apache.volia.net/cassandra/$CASSANDRA_VERSION/apache-cassandra-$CASSANDRA_VERSION-bin.tar.gz"

RUN cd /opt ; \
curl http://apache.volia.net/cassandra/$CASSANDRA_VERSION/apache-cassandra-$CASSANDRA_VERSION-bin.tar.gz | tar zx
curl "http://apache.volia.net/cassandra/$CASSANDRA_VERSION/apache-cassandra-$CASSANDRA_VERSION-bin.tar.gz" | tar zx

ENV PATH /opt/apache-cassandra-$CASSANDRA_VERSION/bin:$PATH

Expand Down

0 comments on commit 45a1782

Please sign in to comment.