Skip to content

Commit ac6053a

Browse files
fix(GetConstraintsPertab): Also work with non-lowercase column names (#10)
* fix(GetConstraintsPertab): Also work with non-lowercase column names Possibly closes #6 * Fix for uppercase column (#1) * Fix for uppercase colum + Uppercase columns are being converted to lowercase and hence error'ng out. this is fixed + Bump the version of the mock-data tool * version bump Co-authored-by: Faisal Ali <[email protected]>
1 parent ae835c3 commit ac6053a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

mock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
var (
99
programName = "mock"
10-
programVersion = "v2.1"
10+
programVersion = "v2.2"
1111
ExecutionTimestamp = TimeNow()
1212
Path = fmt.Sprintf("%s/%s/%s", os.Getenv("HOME"), programName, ExecutionTimestamp)
1313
)

sql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,4 +545,4 @@ WHERE %[2]s = '%[6]s'
545545
Debugf("query: %s", query)
546546
Fatalf("Error when updating the foreign key for table %s, err: %v", key.Table, err)
547547
}
548-
}
548+
}

worker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ DataTypePickerLoop:
158158
// Copy the data to the database table
159159
func CopyData(tab string, col []string, data []string, db *pg.DB) {
160160
// Copy Statement and start loading
161-
copyStatment := fmt.Sprintf(`COPY %s(%s) FROM STDIN WITH CSV DELIMITER '%s' QUOTE e'\x01'`,
162-
tab, strings.Join(col, ","), delimiter)
161+
copyStatment := fmt.Sprintf(`COPY %s("%s") FROM STDIN WITH CSV DELIMITER '%s' QUOTE e'\x01'`,
162+
tab, strings.Join(col, "\",\""), delimiter)
163163
_, err := db.CopyFrom(strings.NewReader(strings.Join(data, delimiter)), copyStatment)
164164

165165
// Handle Error

0 commit comments

Comments
 (0)