Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

var (
programName = "mock"
programVersion = "v2.1"
programVersion = "v2.2"
ExecutionTimestamp = TimeNow()
Path = fmt.Sprintf("%s/%s/%s", os.Getenv("HOME"), programName, ExecutionTimestamp)
)
Expand Down
2 changes: 1 addition & 1 deletion sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,4 +545,4 @@ WHERE %[2]s = '%[6]s'
Debugf("query: %s", query)
Fatalf("Error when updating the foreign key for table %s, err: %v", key.Table, err)
}
}
}
4 changes: 2 additions & 2 deletions worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ DataTypePickerLoop:
// Copy the data to the database table
func CopyData(tab string, col []string, data []string, db *pg.DB) {
// Copy Statement and start loading
copyStatment := fmt.Sprintf(`COPY %s(%s) FROM STDIN WITH CSV DELIMITER '%s' QUOTE e'\x01'`,
tab, strings.Join(col, ","), delimiter)
copyStatment := fmt.Sprintf(`COPY %s("%s") FROM STDIN WITH CSV DELIMITER '%s' QUOTE e'\x01'`,
tab, strings.Join(col, "\",\""), delimiter)
_, err := db.CopyFrom(strings.NewReader(strings.Join(data, delimiter)), copyStatment)

// Handle Error
Expand Down