Skip to content

Commit d76baff

Browse files
committed
add uloc to sql output
1 parent 111d277 commit d76baff

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

processor/formatters.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,8 @@ func toSqlInsert(input chan *FileJob) string {
639639

640640
dir, _ := filepath.Split(res.Location)
641641

642-
str.WriteString(fmt.Sprintf("\ninsert into t values('%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, %d);",
643-
projectName, res.Language, res.Location, dir, res.Filename, res.Bytes, res.Blank, res.Comment, res.Code, res.Complexity))
642+
str.WriteString(fmt.Sprintf("\ninsert into t values('%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, %d, %d);",
643+
projectName, res.Language, res.Location, dir, res.Filename, res.Bytes, res.Blank, res.Comment, res.Code, res.Complexity, res.Uloc))
644644

645645
// every 1000 files commit and start a new transaction to avoid overloading
646646
if count == 1000 {
@@ -649,9 +649,7 @@ func toSqlInsert(input chan *FileJob) string {
649649
count = 0
650650
}
651651
}
652-
if count != 1000 {
653-
str.WriteString("\ncommit;")
654-
}
652+
str.WriteString("\ncommit;")
655653

656654
currentTime := time.Now()
657655
es := float64(makeTimestampMilli()-startTimeMilli) * 0.001
@@ -679,7 +677,9 @@ create table t (
679677
nBlank integer,
680678
nComment integer,
681679
nCode integer,
682-
nComplexity integer );`)
680+
nComplexity integer,
681+
nUloc integer
682+
);`)
683683

684684
str.WriteString(toSqlInsert(input))
685685
return str.String()

0 commit comments

Comments
 (0)