Skip to content

Commit

Permalink
#118: moving database -> demo_database folder, and moving examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lsulak committed Apr 24, 2024
1 parent f25f70f commit 1650f30
Show file tree
Hide file tree
Showing 26 changed files with 7 additions and 43 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
with:
path: |
${{ github.workspace }}/core/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
${{ github.workspace }}/examples/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
${{ github.workspace }}/slick/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
${{ github.workspace }}/doobie/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
key: ${{ runner.os }}-${{ matrix.scalaShort }}-${{ hashFiles('**/jacoco.xml') }}
Expand Down Expand Up @@ -79,7 +78,6 @@ jobs:
with:
path: |
${{ github.workspace }}/core/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
${{ github.workspace }}/examples/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
${{ github.workspace }}/slick/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
${{ github.workspace }}/doobie/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
key: ${{ runner.os }}-${{ matrix.scalaShort }}-${{ hashFiles('**/jacoco.xml') }}
Expand All @@ -95,7 +93,6 @@ jobs:
${{ github.workspace }}/core/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml,
${{ github.workspace }}/slick/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml,
${{ github.workspace }}/doobie/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
# examples don't need code coverage - at least not now
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: ${{ matrix.overall }}
min-coverage-changed-files: ${{ matrix.changed }}
Expand Down
16 changes: 1 addition & 15 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ flywaySqlMigrationSuffixes := FlywayConfiguration.flywaySqlMigrationSuffixes
libraryDependencies ++= flywayDependencies

lazy val parent = (project in file("."))
.aggregate(faDbCore, faDBSlick, faDBDoobie, faDBExamples)
.aggregate(faDbCore, faDBSlick, faDBDoobie)
.settings(
name := "root",
libraryDependencies ++= rootDependencies(scalaVersion.value),
Expand Down Expand Up @@ -110,18 +110,4 @@ lazy val faDBDoobie = (project in file("doobie"))
jacocoExcludes := commonJacocoExcludes
)

lazy val faDBExamples = (project in file("examples"))
.configs(IntegrationTest)
.settings(
name := "examples",
libraryDependencies ++= examplesDependencies(scalaVersion.value),
Test / parallelExecution := false,
(Compile / compile) := ((Compile / compile) dependsOn printScalaVersion).value, // printScalaVersion is run with compile
publish / skip := true
).dependsOn(faDbCore, faDBSlick)
.settings(
jacocoReportSettings := commonJacocoReportSettings.withTitle(s"fa-db:examples Jacoco Report - scala:${scalaVersion.value}"),
jacocoExcludes := commonJacocoExcludes
)

sonatypeProfileName := "za.co.absa"
File renamed without changes.
File renamed without changes.
12 changes: 0 additions & 12 deletions examples/src/main/resources/application.conf

This file was deleted.

Empty file.
4 changes: 0 additions & 4 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ object Dependencies {
)
}

def examplesDependencies(scalaVersion: String): Seq[ModuleID] = {
slickDependencies(scalaVersion)
}

def flywayDependencies: Seq[ModuleID] = {
val postgresql = "org.postgresql" % "postgresql" % "42.6.0"

Expand Down
2 changes: 1 addition & 1 deletion project/FlywayConfiguration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ object FlywayConfiguration {
val flywayUrl = s"jdbc:postgresql://$host:$port/$database"
val flywayUser = "postgres"
val flywayPassword = "postgres"
val flywayLocations: Seq[String] = Seq("filesystem:database/src/main/postgres")
val flywayLocations: Seq[String] = Seq("filesystem:demo_database/src/main/postgres")
val flywaySqlMigrationSuffixes: Seq[String] = Seq(".sql",".ddl")

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@
* limitations under the License.
*/

package za.co.absa.fadb.examples.enceladus
package za.co.absa.fadb.slick

import cats.MonadError
import slick.jdbc.PostgresProfile.api._
import slick.jdbc.{GetResult, SQLActionBuilder}
import za.co.absa.fadb.DBSchema
import za.co.absa.fadb.examples.enceladus.DatasetSchema._
import za.co.absa.fadb.naming.implementations.SnakeCaseNaming.Implicits.namingConvention
import za.co.absa.fadb.slick.DatasetSchema._
import za.co.absa.fadb.slick.SlickFunction.{SlickMultipleResultFunction, SlickSingleResultFunctionWithStatus}
import za.co.absa.fadb.slick.SlickPgEngine
import za.co.absa.fadb.status.handling.implementations.UserDefinedStatusHandling

import java.sql.Timestamp
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future

/* The Schema doesn't need the dBEngine directly, but it seems cleaner this way to hand it over to schema's functions */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@
* limitations under the License.
*/

package za.co.absa.fadb.examples.enceladus
package za.co.absa.fadb.slick

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import za.co.absa.fadb.examples.enceladus.DatasetSchema._
import slick.jdbc.PostgresProfile.api._
import za.co.absa.fadb.exceptions.StatusException
import za.co.absa.fadb.slick.SlickPgEngine
import za.co.absa.fadb.slick.DatasetSchema._

import scala.concurrent.Await
import scala.concurrent.duration.Duration
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration

class DatasetSchemaSuite extends AnyWordSpec with Matchers {
private val db = Database.forConfig("menasdb")
Expand Down

0 comments on commit 1650f30

Please sign in to comment.