aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/Main.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/Main.scala')
-rw-r--r--src/main/scala/Main.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/scala/Main.scala b/src/main/scala/Main.scala
index 5bd84d1..866023d 100644
--- a/src/main/scala/Main.scala
+++ b/src/main/scala/Main.scala
@@ -46,13 +46,15 @@ object Generator {
parentType: Option[String],
idType: Option[String],
header: String,
- schemaImports: List[String],
+ tablesFileImports: List[String],
+ rowsFileImports: List[String],
typeReplacements: Map[String, String]) = {
val dc: DatabaseConfig[JdbcProfile] =
DatabaseConfig.forURI[JdbcProfile](uri)
val parsedSchemasOpt: Option[Map[String, List[String]]] =
schemaNames.map(SchemaParser.parse)
- val imports = schemaImports.map("import " + _).mkString("\n")
+
+ def importStatements(imports: List[String]) = imports.map("import " + _).mkString("\n")
try {
val dbModel: slick.model.Model = Await.result(
@@ -74,7 +76,7 @@ object Generator {
val rowGenerator = new RowSourceCodeGenerator(
model = schemaOnlyModel,
headerComment = header,
- imports = imports,
+ imports = importStatements(rowsFileImports),
schemaName = schemaName,
fullDatabaseModel = dbModel,
idType,
@@ -85,7 +87,7 @@ object Generator {
val tableGenerator =
new TableSourceCodeGenerator(schemaOnlyModel = schemaOnlyModel,
headerComment = header,
- imports = imports,
+ imports = importStatements(tablesFileImports),
schemaName = schemaName,
fullDatabaseModel = dbModel,
pkg = pkg,