Skip to content

Commit

Permalink
feat: view code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
MoeQuadrat committed Sep 12, 2024
1 parent e8f08e4 commit 9540961
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .bsp/sbt.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"sbt","version":"1.5.0","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/Users/jona7o/.sdkman/candidates/java/11.0.13.8.1-amzn/bin/java","-Xms100m","-Xmx100m","-classpath","/Users/jona7o/Library/Application Support/JetBrains/IntelliJIdea2021.2/plugins/Scala/launcher/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=/Users/jona7o/Library/Application%20Support/JetBrains/IntelliJIdea2021.2/plugins/Scala/launcher/sbt-launch.jar"]}
{"name":"sbt","version":"1.6.2","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/Users/moritzlintterer/.sdkman/candidates/java/11.0.21-zulu/zulu-11.jdk/Contents/Home/bin/java","-Xms100m","-Xmx100m","-classpath","/Users/moritzlintterer/Library/Application Support/JetBrains/IntelliJIdea2024.2/plugins/Scala/launcher/sbt-launch.jar","-Dsbt.script=/Users/moritzlintterer/.sdkman/candidates/sbt/current/bin/sbt","xsbt.boot.Boot","-bsp"]}
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import sbt.{ Def, _ }
//settings

name := """scala-utils"""
val releaseVersion = "1.5.7"
val releaseVersion = "1.5.7-View"

val token = sys.env.getOrElse("GITHUB_TOKEN", "")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package de.innfactory.play.db.codegen

import com.github.tminglei.slickpg.ExPostgresProfile
import slick.codegen.SourceCodeGenerator
import slick.jdbc.meta.MTable
import slick.sql.SqlProfile.ColumnOption

import scala.concurrent.duration._
Expand Down Expand Up @@ -94,7 +95,8 @@ abstract class CustomizedCodeGeneratorBase[T <: ExPostgresProfile](customizedCod
val db = slickProfile.api.Database.forURL(config.url, driver = config.jdbcDriver)

lazy val codegen: Future[SourceCodeGenerator] = db.run {
config.slickProfile.defaultTables.map(_.filter(t => included contains t.name.name.toUpperCase))
MTable.getTables(None, None, Some("%"), Some(Seq("TABLE", "VIEW")))
.map(_.filter(t => included contains t.name.name.toUpperCase))
.flatMap(
config.slickProfile
.createModelBuilder(_, ignoreInvalidDefaults = false)
Expand Down

0 comments on commit 9540961

Please sign in to comment.