Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
feat: make save to projects
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Apr 2, 2022
1 parent ddc569c commit 97d1ff5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ class ClassRepository(systemId: String, language: String, workspace: String) {
}
if (field.TypeValue.contains("\n")) {
println("contains \n will give up: --------------\n-------------")
println(field.TypeValue)
name = ""
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ class DatamapRepository(systemId: String, language: String, workspace: String) {
values["function_name"] = relation.functionName

values["tables"] = relation.tables.joinToString(",")
values["sqls"] = ""

// `,` is a symbol in sql
values["sqls"] = relation.sqls.joinToString("\n::archguard::\n") {
it.replace("\'", "\'\'")
}

batch.add("data_code_database_relation", values)
return id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ class Runner : CliktCommand(help = "scan git to sql") {
val apiAnalyser = MysqlAnalyser()
val records = dataStructs.flatMap { data ->
apiAnalyser.analysisByNode(data, "")
}
.toList()

}.toList()

val datamapRepository = DatamapRepository(systemId, language, path)
datamapRepository.saveRelations(records)
Expand Down

0 comments on commit 97d1ff5

Please sign in to comment.